java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The smallest sample I could create is the following. We've got two Groovy classes, one of which is a trait and another implements that trait. {code:title=TestTrait.groovy} package test trait TestTrait { Object userRepository Object respondentRepository Object surveyStatsRepository Object surveyRepository Object questionRepository Object questionOptionRepository Object answerRepository Object surveyInvitationRepository Object invitationDeliveryRepository Object surveyPatternRepository Object accessNumberRepository Object deliverySubscriberRepository } {code} {code:title=TestClass.groovy} package test class TestClass implements TestTrait { } {code} Then let's compile those using the command line: {code} $ JAVA_HOME/bin/java -cp ../lib/groovy-all-2.4.3.jar org.codehaus.groovy.tools.FileSystemCompiler -cp ../lib/groovy-all-2.4.3.jar test/* {code} This results in the following compiler error: {code} org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during canonicalization: Comparison method violates its general contract! java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeLo(TimSort.java:747) at java.util.TimSort.mergeAt(TimSort.java:483) at java.util.TimSort.mergeCollapse(TimSort.java:410) at java.util.TimSort.sort(TimSort.java:214) at java.util.TimSort.sort(TimSort.java:173) at java.util.Arrays.sort(Arrays.java:659) at java.util.Collections.sort(Collections.java:217) at org.codehaus.groovy.transform.trait.TraitComposer.applyTrait(TraitComposer.java:202) at org.codehaus.groovy.transform.trait.TraitComposer.doExtendTraits(TraitComposer.java:111) at org.codehaus.groovy.control.CompilationUnit$4.call(CompilationUnit.java:188) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1052) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:588) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:522) at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:59) at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:215) at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:148) at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:178) at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:162) 1 error {code}
    via by Andy Belsky,
  • The smallest sample I could create is the following. We've got two Groovy classes, one of which is a trait and another implements that trait. {code:title=TestTrait.groovy} package test trait TestTrait { Object userRepository Object respondentRepository Object surveyStatsRepository Object surveyRepository Object questionRepository Object questionOptionRepository Object answerRepository Object surveyInvitationRepository Object invitationDeliveryRepository Object surveyPatternRepository Object accessNumberRepository Object deliverySubscriberRepository } {code} {code:title=TestClass.groovy} package test class TestClass implements TestTrait { } {code} Then let's compile those using the command line: {code} $ JAVA_HOME/bin/java -cp ../lib/groovy-all-2.4.3.jar org.codehaus.groovy.tools.FileSystemCompiler -cp ../lib/groovy-all-2.4.3.jar test/* {code} This results in the following compiler error: {code} org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during canonicalization: Comparison method violates its general contract! java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeLo(TimSort.java:747) at java.util.TimSort.mergeAt(TimSort.java:483) at java.util.TimSort.mergeCollapse(TimSort.java:410) at java.util.TimSort.sort(TimSort.java:214) at java.util.TimSort.sort(TimSort.java:173) at java.util.Arrays.sort(Arrays.java:659) at java.util.Collections.sort(Collections.java:217) at org.codehaus.groovy.transform.trait.TraitComposer.applyTrait(TraitComposer.java:202) at org.codehaus.groovy.transform.trait.TraitComposer.doExtendTraits(TraitComposer.java:111) at org.codehaus.groovy.control.CompilationUnit$4.call(CompilationUnit.java:188) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1052) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:588) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:522) at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:59) at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:215) at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:148) at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:178) at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:162) 1 error {code}
    via by Andy Belsky,
  • Convert libs repo to Java 7
    via GitHub by jtesser
    ,
  • Neighborhood Fails!
    via GitHub by d-krupke
    ,
    • java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeLo(TimSort.java:747) at java.util.TimSort.mergeAt(TimSort.java:483) at java.util.TimSort.mergeCollapse(TimSort.java:410) at java.util.TimSort.sort(TimSort.java:214) at java.util.TimSort.sort(TimSort.java:173) at java.util.Arrays.sort(Arrays.java:659) at java.util.Collections.sort(Collections.java:217) at org.codehaus.groovy.transform.trait.TraitComposer.applyTrait(TraitComposer.java:202) at org.codehaus.groovy.transform.trait.TraitComposer.doExtendTraits(TraitComposer.java:111) at org.codehaus.groovy.control.CompilationUnit$4.call(CompilationUnit.java:188) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1052) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:588) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:522) at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:59) at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:215) at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:148) at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompileWithErrorHandling(FileSystemCompiler.java:178) at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:162)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    12 more bugmates