From b0286ae5ff98f55b2fec18fc43064c72469ded62 Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Sat, 4 Aug 2012 23:33:04 +0000 Subject: [PATCH] * Fixed "IllegalArgumentException: Comparison method violates its general contract!" issue with CollisionResults git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9618 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/collision/CollisionResult.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/engine/src/core/com/jme3/collision/CollisionResult.java b/engine/src/core/com/jme3/collision/CollisionResult.java index aef39367f..4da2ac386 100644 --- a/engine/src/core/com/jme3/collision/CollisionResult.java +++ b/engine/src/core/com/jme3/collision/CollisionResult.java @@ -99,12 +99,7 @@ public class CollisionResult implements Comparable { } public int compareTo(CollisionResult other) { - if (distance < other.distance) - return -1; - else if (distance > other.distance) - return 1; - else - return 0; + return Float.compare(distance, other.distance); } @Override