From b5910f18f0b82a8a1f6f6252dc19971d5e487f39 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 8 Jul 2014 10:10:39 +0200 Subject: Findbugs.normal: Adding safeguard hashCode() implementation throwing InternalError("hashCode not designed") As long we don't use Object.hashCode() to idenitify the memory address, we can safeguard the code. --- src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java | 5 +++++ src/jogl/classes/com/jogamp/graph/geom/Outline.java | 4 ++++ src/jogl/classes/com/jogamp/graph/geom/SVertex.java | 4 ++++ src/jogl/classes/com/jogamp/opengl/math/Quaternion.java | 4 ++++ src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java | 4 ++++ src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java | 4 ++++ 6 files changed, 25 insertions(+) (limited to 'src/jogl') diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java index 939035c69..e7c452fb4 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java +++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java @@ -791,4 +791,9 @@ public class OutlineShape implements Comparable { } return true; } + + @Override + public final int hashCode() { + throw new InternalError("hashCode not designed"); + } } diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java index ea2059165..4caf06e5d 100644 --- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java +++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java @@ -274,4 +274,8 @@ public class Outline implements Comparable { } return true; } + @Override + public final int hashCode() { + throw new InternalError("hashCode not designed"); + } } diff --git a/src/jogl/classes/com/jogamp/graph/geom/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java index 8df8fbb31..4846ff5f1 100644 --- a/src/jogl/classes/com/jogamp/graph/geom/SVertex.java +++ b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java @@ -185,6 +185,10 @@ public class SVertex implements Vertex { VectorUtil.isVec3Equal(getTexCoord(), 0, v.getTexCoord(), 0, FloatUtil.EPSILON) && VectorUtil.isVec3Equal(getCoord(), 0, v.getCoord(), 0, FloatUtil.EPSILON) ; } + @Override + public final int hashCode() { + throw new InternalError("hashCode not designed"); + } @Override public final float[] getTexCoord() { diff --git a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java index 5e0784022..430450767 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java +++ b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java @@ -1198,6 +1198,10 @@ public class Quaternion { Math.abs(z - comp.getZ()) <= ALLOWED_DEVIANCE && Math.abs(w - comp.getW()) <= ALLOWED_DEVIANCE; } + @Override + public final int hashCode() { + throw new InternalError("hashCode not designed"); + } public String toString() { return "Quaternion[x "+x+", y "+y+", z "+z+", w "+w+"]"; diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java index e454c036a..4caff95ea 100644 --- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java +++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java @@ -673,6 +673,10 @@ public class AABBox { return VectorUtil.isVec2Equal(low, 0, other.low, 0, FloatUtil.EPSILON) && VectorUtil.isVec3Equal(high, 0, other.high, 0, FloatUtil.EPSILON) ; } + @Override + public final int hashCode() { + throw new InternalError("hashCode not designed"); + } /** * Assume this bounding box as being in object space and diff --git a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java index 909240c76..57239ac48 100644 --- a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java +++ b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java @@ -586,5 +586,9 @@ public class AffineTransform implements Cloneable { } return false; } + @Override + public final int hashCode() { + throw new InternalError("hashCode not designed"); + } } -- cgit v1.2.3