Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-23384

PortletLuceneComparator does not implement Comparator interface properly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0.6 GA, 6.1.0 CE RC1
    • Fix Version/s: --Sprint 12/11, 6.1.0 CE RC1
    • Component/s: Performance
    • Labels:
      None
    • Environment:
      Windows xp, 6.0.6 GA

      Description

      PortletLuceneComparator does not implement Comparator interface properly. Checking interface documentation states "The implementor must ensure that sgn(compare(x, y)) == -sgn(compare(y, x)) for all x and y." - It returns 1 only if the first argument is PortletKeys.DOCUMENT_LIBRARY, it should also return -1 if the second argument is PortletKeys.DOCUMENT_LIBRARY.

      I have run a simulated test that successfully runs with new code.

      Attached is possible fix.

        Attachments

          Activity

            People

            • Assignee:
              hugo.huijser Hugo Huijser
              Reporter:
              illusionalsin Gareth Carter (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 48 weeks, 1 day ago