JDK-7193557 : SEVERE Comparison method violates its general contract!
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: linux,windows_7
  • CPU: x86
  • Submitted: 2012-08-23
  • Updated: 2013-08-13
  • Resolved: 2012-08-23
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java -version
java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux user 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
SEVERE Comparison method violates its general contract!
java.lang.IllegalArgumentException: Comparison method violates its general contract!
	at java.util.TimSort.mergeHi(Unknown Source)
	at java.util.TimSort.mergeAt(Unknown Source)
	at java.util.TimSort.mergeCollapse(Unknown Source)
	at java.util.TimSort.sort(Unknown Source)
	at java.util.TimSort.sort(Unknown Source)
	at java.util.Arrays.sort(Unknown Source)
	at net.l2emuproject.gameserver.network.serverpackets.EffectInfoPacket$EffectInfoPacketList.<init>(EffectInfoPacket.java:66)
	at net.l2emuproject.gameserver.model.actor.instance.L2PcInstance.updateEffectIcons(L2PcInstance.java:3813)
	at net.l2emuproject.gameserver.model.actor.effects.CharEffectList.removeEffect(CharEffectList.java:358)
	at net.l2emuproject.gameserver.model.L2Effect.stopEffectTask(L2Effect.java:417)
	at net.l2emuproject.gameserver.model.L2Effect.scheduleEffect(L2Effect.java:490)
	at net.l2emuproject.gameserver.model.L2Effect$EffectTask.run(L2Effect.java:104)
	at net.l2emuproject.util.concurrent.ExecuteWrapper.execute(ExecuteWrapper.java:59)
	at net.l2emuproject.util.concurrent.ExecuteWrapper.run(ExecuteWrapper.java:40)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


REGRESSION.  Last worked in version 7


REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION The following is in the JDK7 release notes: "The sorting algorithm used by java.util.Arrays.sort and (indirectly) by java.util.Collections.sort has been replaced. The new sort implementation may throw an IllegalArgumentException if it detects a Comparable that violates the Comparable contract. The previous implementation silently ignored such a situation. If the previous behavior is desired, you can use the new system property, java.util.Arrays.useLegacyMergeSort, to restore previous mergesort behavior."
23-08-2012