java.lang.IllegalArgumentException: Comparison method violates its general contract!

YouTrack | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Exception during build finish

    YouTrack | 1 year ago
    java.lang.IllegalArgumentException: Comparison method violates its general contract!
  2. 0

    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}

    Apache's JIRA Issue Tracker | 2 years ago | Andy Belsky
    java.lang.IllegalArgumentException: Comparison method violates its general contract!
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Requesting from behind an iron pipe throws an exception and kicks the client

    GitHub | 6 months ago | firelizzard18
    java.lang.IllegalArgumentException: Comparison method violates its general contract!
  5. 0

    Comparison method violates its general contract

    GitHub | 5 months ago | tomtom5152
    java.lang.IllegalArgumentException: Comparison method violates its general contract!

    17 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Comparison method violates its general contract!

      at java.util.TimSort.mergeLo()
    2. Java RT
      Collections.sort
      1. java.util.TimSort.mergeLo(TimSort.java:777)
      2. java.util.TimSort.mergeAt(TimSort.java:514)
      3. java.util.TimSort.mergeCollapse(TimSort.java:441)
      4. java.util.TimSort.sort(TimSort.java:245)
      5. java.util.Arrays.sort(Arrays.java:1512)
      6. java.util.ArrayList.sort(ArrayList.java:1454)
      7. java.util.Collections.sort(Collections.java:175)
      7 frames
    3. jetbrains.buildServer.torrent
      ServerTorrentsDirectorySeeder$4.processBuildArtifact
      1. jetbrains.buildServer.torrent.seeder.TorrentFilesDB.getSortedKeys(TorrentFilesDB.java:166)
      2. jetbrains.buildServer.torrent.seeder.TorrentFilesDB.flush(TorrentFilesDB.java:139)
      3. jetbrains.buildServer.torrent.seeder.TorrentsSeeder.flushTorrentsDB(TorrentsSeeder.java:127)
      4. jetbrains.buildServer.torrent.seeder.TorrentsSeeder.registerSrcAndTorrentFile(TorrentsSeeder.java:87)
      5. jetbrains.buildServer.torrent.ServerTorrentsDirectorySeeder.processArtifactInternal(ServerTorrentsDirectorySeeder.java:190)
      6. jetbrains.buildServer.torrent.ServerTorrentsDirectorySeeder.processArtifactInternal(ServerTorrentsDirectorySeeder.java:181)
      7. jetbrains.buildServer.torrent.ServerTorrentsDirectorySeeder$4.processBuildArtifact(ServerTorrentsDirectorySeeder.java:169)
      7 frames
    4. jetbrains.buildServer.serverSide
      BuildArtifactsImpl.iterateArtifacts
      1. jetbrains.buildServer.serverSide.impl.artifacts.BuildArtifactsImpl.iterate(BuildArtifactsImpl.java:61)
      2. jetbrains.buildServer.serverSide.impl.artifacts.BuildArtifactsImpl.iterateArtifacts(BuildArtifactsImpl.java:52)
      2 frames
    5. jetbrains.buildServer.torrent
      ServerTorrentsDirectorySeeder$1.buildFinished
      1. jetbrains.buildServer.torrent.ServerTorrentsDirectorySeeder.announceBuildArtifacts(ServerTorrentsDirectorySeeder.java:166)
      2. jetbrains.buildServer.torrent.ServerTorrentsDirectorySeeder.access$300(ServerTorrentsDirectorySeeder.java:35)
      3. jetbrains.buildServer.torrent.ServerTorrentsDirectorySeeder$1.buildFinished(ServerTorrentsDirectorySeeder.java:73)
      3 frames
    6. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor394.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      3. java.lang.reflect.Method.invoke(Method.java:498)
      3 frames
    7. TeamCity Build Server
      EventDispatcher$2.invoke
      1. jetbrains.buildServer.util.EventDispatcher.dispatch(EventDispatcher.java:121)
      2. jetbrains.buildServer.serverSide.ServerSideEventDispatcher.superDispatch(ServerSideEventDispatcher.java:59)
      3. jetbrains.buildServer.serverSide.ServerSideEventDispatcher$1.run(ServerSideEventDispatcher.java:49)
      4. jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAs(SecurityContextImpl.java:118)
      5. jetbrains.buildServer.serverSide.impl.auth.SecurityContextImpl.runAsSystem(SecurityContextImpl.java:102)
      6. jetbrains.buildServer.serverSide.ServerSideEventDispatcher.dispatch(ServerSideEventDispatcher.java:47)
      7. jetbrains.buildServer.util.EventDispatcher$2.invoke(EventDispatcher.java:68)
      7 frames
    8. com.sun.proxy
      $Proxy20.buildFinished
      1. com.sun.proxy.$Proxy20.buildFinished(Unknown Source)
      1 frame
    9. jetbrains.buildServer.serverSide
      RunningBuildsManagerImpl$5.run
      1. jetbrains.buildServer.serverSide.impl.RunningBuildsManagerImpl.finishBuild(RunningBuildsManagerImpl.java:168)
      2. jetbrains.buildServer.serverSide.impl.RunningBuildsManagerImpl.access$600(RunningBuildsManagerImpl.java:34)
      3. jetbrains.buildServer.serverSide.impl.RunningBuildsManagerImpl$5.run(RunningBuildsManagerImpl.java:508)
      3 frames
    10. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:266)
      3. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      5. java.lang.Thread.run(Thread.java:745)
      5 frames