diff options
author | Harvey Harrison <[email protected]> | 2013-01-27 14:22:03 -0800 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2013-01-27 14:22:03 -0800 |
commit | 352bd75101b967c21606f79bd1dd069503938683 (patch) | |
tree | 6dc8e17a40deab3e21b7f4f33f3d575356ae5e71 /src | |
parent | 3531f53765d808a83deab8b229beab4df2294ff5 (diff) |
j3dcode: sweep up some trivial warning fixes
- unused temp variables
- casts that are unnecessary
- convert an instanceof that is effectively a null-check
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
13 files changed, 8 insertions, 17 deletions
diff --git a/src/classes/share/javax/media/j3d/CompressedGeometryRenderMethod.java b/src/classes/share/javax/media/j3d/CompressedGeometryRenderMethod.java index 2c2f093..54650e1 100644 --- a/src/classes/share/javax/media/j3d/CompressedGeometryRenderMethod.java +++ b/src/classes/share/javax/media/j3d/CompressedGeometryRenderMethod.java @@ -38,9 +38,6 @@ class CompressedGeometryRenderMethod implements RenderMethod { */ public boolean render(RenderMolecule rm, Canvas3D cv, RenderAtomListInfo ra, int dirtyBits) { - - CompressedGeometryRetained cgr ; - if (rm.doInfinite) { cv.updateState(dirtyBits); while (ra != null) { diff --git a/src/classes/share/javax/media/j3d/CompressedGeometryRetained.java b/src/classes/share/javax/media/j3d/CompressedGeometryRetained.java index b121b46..4a2f5af 100644 --- a/src/classes/share/javax/media/j3d/CompressedGeometryRetained.java +++ b/src/classes/share/javax/media/j3d/CompressedGeometryRetained.java @@ -278,7 +278,7 @@ class CompressedGeometryRetained extends GeometryRetained { else { // Return this object if hardware decompression is available. if (hardwareDecompression) - return (GeometryRetained)this ; + return this; // Check to see if hardware decompression is available. if (decompressHW(cv.ctx, majorVersionNumber, minorVersionNumber)) { @@ -289,7 +289,7 @@ class CompressedGeometryRetained extends GeometryRetained { createByCopy(compressedGeometry) ; } - return (GeometryRetained)this ; + return this; } // Decompress the data into a GeometryArrayRetained representation diff --git a/src/classes/share/javax/media/j3d/ConeSoundRetained.java b/src/classes/share/javax/media/j3d/ConeSoundRetained.java index 4853485..c6dc046 100644 --- a/src/classes/share/javax/media/j3d/ConeSoundRetained.java +++ b/src/classes/share/javax/media/j3d/ConeSoundRetained.java @@ -605,7 +605,6 @@ class ConeSoundRetained extends PointSoundRetained { void updateMirrorObject(Object[] objs) { if (debugFlag) debugPrint("PointSoundRetained:updateMirrorObj()"); - Transform3D trans = null; int component = ((Integer)objs[1]).intValue(); int numSnds = ((Integer)objs[2]).intValue(); SoundRetained[] mSnds = (SoundRetained[]) objs[3]; diff --git a/src/classes/share/javax/media/j3d/DirectionalLightRetained.java b/src/classes/share/javax/media/j3d/DirectionalLightRetained.java index a370c1c..89817f6 100644 --- a/src/classes/share/javax/media/j3d/DirectionalLightRetained.java +++ b/src/classes/share/javax/media/j3d/DirectionalLightRetained.java @@ -146,7 +146,6 @@ class DirectionalLightRetained extends LightRetained void updateMirrorObject(Object[] objs) { int i; int component = ((Integer)objs[1]).intValue(); - Transform3D trans; int numLgts = ((Integer)objs[2]).intValue(); LightRetained[] mLgts = (LightRetained[]) objs[3]; diff --git a/src/classes/share/javax/media/j3d/ImageComponent3DRetained.java b/src/classes/share/javax/media/j3d/ImageComponent3DRetained.java index 4c644a3..fd65ad1 100644 --- a/src/classes/share/javax/media/j3d/ImageComponent3DRetained.java +++ b/src/classes/share/javax/media/j3d/ImageComponent3DRetained.java @@ -241,7 +241,7 @@ class ImageComponent3DRetained extends ImageComponentRetained { else { for (i = 0; i < depth; i++) { bi[i] = imageData.createBufferedImage(i); - if (!(bi[i] instanceof BufferedImage)) { + if (bi[i] == null) { throw new IllegalStateException(J3dI18N.getString("ImageComponent3DRetained0")); } diff --git a/src/classes/share/javax/media/j3d/IndexedTriangleFanArrayRetained.java b/src/classes/share/javax/media/j3d/IndexedTriangleFanArrayRetained.java index ac878f4..fec3a4d 100644 --- a/src/classes/share/javax/media/j3d/IndexedTriangleFanArrayRetained.java +++ b/src/classes/share/javax/media/j3d/IndexedTriangleFanArrayRetained.java @@ -335,7 +335,7 @@ class IndexedTriangleFanArrayRetained extends IndexedGeometryStripArrayRetained // intersect pnts[] with every triangle in this object boolean intersect(Point3d[] pnts) { - int j, end; + int j; Point3d[] points = new Point3d[3]; double dist[] = new double[1]; int i = 0, scount, count = 0; diff --git a/src/classes/share/javax/media/j3d/IndexedTriangleStripArrayRetained.java b/src/classes/share/javax/media/j3d/IndexedTriangleStripArrayRetained.java index 45ea154..e7fd70f 100644 --- a/src/classes/share/javax/media/j3d/IndexedTriangleStripArrayRetained.java +++ b/src/classes/share/javax/media/j3d/IndexedTriangleStripArrayRetained.java @@ -348,7 +348,7 @@ class IndexedTriangleStripArrayRetained extends IndexedGeometryStripArrayRetaine // intersect pnts[] with every triangle in this object boolean intersect(Point3d[] pnts) { - int j, end; + int j; Point3d[] points = new Point3d[3]; double dist[] = new double[1]; int i = 0, scount, count = 0; diff --git a/src/classes/share/javax/media/j3d/InputDeviceScheduler.java b/src/classes/share/javax/media/j3d/InputDeviceScheduler.java index 2cd483c..d8d4150 100644 --- a/src/classes/share/javax/media/j3d/InputDeviceScheduler.java +++ b/src/classes/share/javax/media/j3d/InputDeviceScheduler.java @@ -27,7 +27,6 @@ package javax.media.j3d; import java.util.ArrayList; -import java.util.Vector; /** * This thread manages all input device scheduling. It monitors and caches diff --git a/src/classes/share/javax/media/j3d/Interpolator.java b/src/classes/share/javax/media/j3d/Interpolator.java index 8863125..bb00eff 100644 --- a/src/classes/share/javax/media/j3d/Interpolator.java +++ b/src/classes/share/javax/media/j3d/Interpolator.java @@ -51,8 +51,7 @@ public abstract class Interpolator extends Behavior { * Interpolator; this can be done with the following method call: * wakeupOn(defaultWakeupCriterion). */ - protected WakeupCriterion defaultWakeupCriterion = - (WakeupCriterion) new WakeupOnElapsedFrames(0); + protected WakeupCriterion defaultWakeupCriterion = new WakeupOnElapsedFrames(0); /** diff --git a/src/classes/share/javax/media/j3d/J3dI18N.java b/src/classes/share/javax/media/j3d/J3dI18N.java index 633ea1f..c6ddf21 100644 --- a/src/classes/share/javax/media/j3d/J3dI18N.java +++ b/src/classes/share/javax/media/j3d/J3dI18N.java @@ -34,7 +34,7 @@ class J3dI18N { static String getString(String key) { String s; try { - s = (String) ResourceBundle.getBundle("javax.media.j3d.ExceptionStrings").getString(key); + s = ResourceBundle.getBundle("javax.media.j3d.ExceptionStrings").getString(key); } catch (MissingResourceException e) { System.err.println("J3dI18N: Error looking up: " + key); diff --git a/src/classes/share/javax/media/j3d/LightSet.java b/src/classes/share/javax/media/j3d/LightSet.java index a7c0880..db4f065 100644 --- a/src/classes/share/javax/media/j3d/LightSet.java +++ b/src/classes/share/javax/media/j3d/LightSet.java @@ -79,7 +79,6 @@ class LightSet extends Object { boolean equals(RenderBin rb, LightRetained[] lights, int nlights, boolean lightOn) { int i, j; - LightRetained light; if (this.nlights != nlights) return(false); diff --git a/src/classes/share/javax/media/j3d/LinearFogRetained.java b/src/classes/share/javax/media/j3d/LinearFogRetained.java index 39a09d7..deb19b3 100644 --- a/src/classes/share/javax/media/j3d/LinearFogRetained.java +++ b/src/classes/share/javax/media/j3d/LinearFogRetained.java @@ -166,7 +166,6 @@ class LinearFogRetained extends FogRetained { synchronized void updateMirrorObject(Object[] objs) { int component = ((Integer)objs[1]).intValue(); - Transform3D trans; if ((component & FRONT_DISTANCE_CHANGED) != 0) ((LinearFogRetained)mirrorFog).frontDistance = ((Double)objs[2]).doubleValue(); diff --git a/src/classes/share/javax/media/j3d/NnuIdManager.java b/src/classes/share/javax/media/j3d/NnuIdManager.java index cbb4dc6..16fa62d 100644 --- a/src/classes/share/javax/media/j3d/NnuIdManager.java +++ b/src/classes/share/javax/media/j3d/NnuIdManager.java @@ -280,7 +280,7 @@ class NnuIdManager { for(i=nnuIdArr0.length, j=0; i<size; i++, j++) { // True or false, it doesn't matter. - equals((NnuId[])newNnuIdArr, nnuIdArr1[j], index, 0, i); + equals(newNnuIdArr, nnuIdArr1[j], index, 0, i); if(index[0] == i) { // Append to last. newNnuIdArr[i] = nnuIdArr1[j]; |