Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-4866

ActivationsSorter: Comparison method violates its general contract!

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 7.30.0.Final
    • None
    • None
      • JDK 1.8.0_181 (64 bit)
    • 2019 Week 50-52 (from Dec 9)
    • Hide

      Unfortunately I can't provide real data in order to reproduce the error, since the data is sensible. However I've managed to mock the activations which trigger the exception on sorting. I've attached a test to reproduce the error.

      • Run SortTest.test, the test fails with an IllegalArgumentException
      • The activations are stored in testdata.txt

      Each line in testdata.txt represents an activation: <rulename>:[<ids of handles>]

      Show
      Unfortunately I can't provide real data in order to reproduce the error, since the data is sensible. However I've managed to mock the activations which trigger the exception on sorting. I've attached a test to reproduce the error. Run SortTest.test, the test fails with an IllegalArgumentException The activations are stored in testdata.txt Each line in testdata.txt represents an activation: <rulename>:[<ids of handles>]
    • NEW
    • NEW

      Hi.

      While serializing a session with ProtobufOutputMarshaller we've encountered an exception in a few rare cases when the activations are sorted by Collections.sort( dormant, ActivationsSorter.INSTANCE ):

      Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
      	at java.util.TimSort.mergeHi(TimSort.java:899)
      	at java.util.TimSort.mergeAt(TimSort.java:516)
      	at java.util.TimSort.mergeForceCollapse(TimSort.java:457)
      	at java.util.TimSort.sort(TimSort.java:254)
      	at java.util.Arrays.sort(Arrays.java:1512)
      	at java.util.ArrayList.sort(ArrayList.java:1462)
      	at java.util.Collections.sort(Collections.java:175)
      	(...)
      

              mfusco@redhat.com Mario Fusco
              lsotnk Leonid Sotnikov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: