PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-23384

PortletLuceneComparator does not implement Comparator interface properly

    Details

    • Type: Bug Bug
    • Status: Closed
    • 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
    • Similar Issues:
      Show 5 results 

      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.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Hugo Huijser
            Reporter:
            Gareth Carter
            Recent user:
            Randy Zhu
            Participants of an Issue:
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 21 weeks, 4 days ago

              Development

                Structure Helper Panel