diff options
author | Sven Gothel <[email protected]> | 2014-07-08 21:09:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-08 21:09:30 +0200 |
commit | a41db57df54863566b0e286cd100bbbc5518eb7f (patch) | |
tree | fb82077e79f54ba2fcf4c77b42458572fd9995eb /src/jogl/classes/com | |
parent | b740161d456c059d1b51029c603ce144eb2b2d44 (diff) |
Findbugs: Use <NumberType>.valueOf(..) instead of 'new <NumberType>(..)'
Diffstat (limited to 'src/jogl/classes/com')
5 files changed, 19 insertions, 22 deletions
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java index a84da723f..bbfe72b08 100644 --- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java @@ -322,7 +322,7 @@ public class Mixer { private static Map createdBuffers = new HashMap(); // Map Long, ByteBuffer private static ByteBuffer newDirectByteBuffer(final long address, final long capacity) { - final Long key = new Long(address); + final Long key = Long.valueOf(address); ByteBuffer buf = (ByteBuffer) createdBuffers.get(key); if (buf == null) { buf = newDirectByteBufferImpl(address, capacity); @@ -351,9 +351,9 @@ public class Mixer { try { return (ByteBuffer) directByteBufferConstructor.newInstance(new Object[] { - new Integer((int) capacity), + Integer.valueOf((int) capacity), null, - new Integer((int) address) + Integer.valueOf((int) address) }); } catch (final Exception e) { e.printStackTrace(); diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java index 1c9eacec0..763b13954 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java @@ -1582,7 +1582,7 @@ public class TextRenderer { class GlyphProducer { final int undefined = -2; - FontRenderContext fontRenderContext = null; // FIXME: Never initialized! + final FontRenderContext fontRenderContext = null; // FIXME: Never initialized! List<Glyph> glyphsOutput = new ArrayList<Glyph>(); HashMap<String, GlyphVector> fullGlyphVectorCache = new HashMap<String, GlyphVector>(); HashMap<Character, GlyphMetrics> glyphMetricsCache = new HashMap<Character, GlyphMetrics>(); @@ -1749,7 +1749,7 @@ public class TextRenderer { static { for (int i = 0; i < cache.length; i++) { - cache[i] = new Character((char) i); + cache[i] = Character.valueOf((char) i); } } @@ -1757,7 +1757,7 @@ public class TextRenderer { if (c <= 127) { // must cache return CharacterCache.cache[c]; } - return new Character(c); + return Character.valueOf(c); } } diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java index c841f2f09..d758fc121 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java @@ -347,8 +347,7 @@ public class ShaderState { public void bindAttribLocation(final GL2ES2 gl, final int location, final String name) { if(null==shaderProgram) throw new GLException("No program is attached"); if(shaderProgram.linked()) throw new GLException("Program is already linked"); - final Integer loc = new Integer(location); - activeAttribLocationMap.put(name, loc); + activeAttribLocationMap.put(name, Integer.valueOf(location)); gl.glBindAttribLocation(shaderProgram.program(), location, name); } @@ -371,7 +370,7 @@ public class ShaderState { if(null==shaderProgram) throw new GLException("No program is attached"); if(shaderProgram.linked()) throw new GLException("Program is already linked"); final String name = data.getName(); - activeAttribLocationMap.put(name, new Integer(location)); + activeAttribLocationMap.put(name, Integer.valueOf(location)); data.setLocation(gl, shaderProgram.program(), location); activeAttribDataMap.put(data.getName(), data); } @@ -399,7 +398,7 @@ public class ShaderState { if(!shaderProgram.linked()) throw new GLException("Program is not linked"); location = gl.glGetAttribLocation(shaderProgram.program(), name); if(0<=location) { - activeAttribLocationMap.put(name, new Integer(location)); + activeAttribLocationMap.put(name, Integer.valueOf(location)); if(DEBUG) { System.err.println("ShaderState: glGetAttribLocation: "+name+", loc: "+location); } @@ -442,8 +441,7 @@ public class ShaderState { if(!shaderProgram.linked()) throw new GLException("Program is not linked"); location = data.setLocation(gl, shaderProgram.program()); if(0<=location) { - final Integer idx = new Integer(location); - activeAttribLocationMap.put(name, idx); + activeAttribLocationMap.put(name, Integer.valueOf(location)); if(DEBUG) { System.err.println("ShaderState: glGetAttribLocation: "+name+", loc: "+location); } @@ -721,7 +719,7 @@ public class ShaderState { final String name = attribute.getName(); final int loc = attribute.setLocation(gl, shaderProgram.program()); if(0<=loc) { - activeAttribLocationMap.put(name, new Integer(loc)); + activeAttribLocationMap.put(name, Integer.valueOf(loc)); if(DEBUG) { System.err.println("ShaderState: relocateAttribute: "+name+", loc: "+loc); } @@ -873,8 +871,7 @@ public class ShaderState { if(!shaderProgram.linked()) throw new GLException("Program is not linked"); location = gl.glGetUniformLocation(shaderProgram.program(), name); if(0<=location) { - final Integer idx = new Integer(location); - activeUniformLocationMap.put(name, idx); + activeUniformLocationMap.put(name, Integer.valueOf(location)); } else if(verbose) { System.err.println("ShaderState: glUniform failed, no location for: "+name+", index: "+location); if(DEBUG) { @@ -915,7 +912,7 @@ public class ShaderState { if(!shaderProgram.linked()) throw new GLException("Program is not linked"); location = data.setLocation(gl, shaderProgram.program()); if(0<=location) { - activeUniformLocationMap.put(name, new Integer(location)); + activeUniformLocationMap.put(name, Integer.valueOf(location)); } else if(verbose) { System.err.println("ShaderState: glUniform failed, no location for: "+name+", index: "+location); if(DEBUG) { @@ -1005,7 +1002,7 @@ public class ShaderState { final int loc = data.setLocation(gl, shaderProgram.program()); if( 0 <= loc ) { // only pass the data, if the uniform exists in the current shader - activeUniformLocationMap.put(data.getName(), new Integer(loc)); + activeUniformLocationMap.put(data.getName(), Integer.valueOf(loc)); if(DEBUG) { System.err.println("ShaderState: resetAllUniforms: "+data); } diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java index b927e8ceb..5ff64d81b 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java @@ -169,7 +169,7 @@ public class ShaderUtil { final int[] formats = new int[numFormats]; gl.glGetIntegerv(GL2ES2.GL_SHADER_BINARY_FORMATS, formats, 0); for(int i=0; i<numFormats; i++) { - info.shaderBinaryFormats.add(new Integer(formats[i])); + info.shaderBinaryFormats.add(Integer.valueOf(formats[i])); } } } catch (final GLException gle) { @@ -200,7 +200,7 @@ public class ShaderUtil { v = true; } } - info.shaderCompilerAvailable = new Boolean(v); + info.shaderCompilerAvailable = Boolean.valueOf(v); queryOK = true; } catch (final GLException gle) { System.err.println("Caught exception on thread "+Thread.currentThread().getName()); diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java index f121478e7..772df7279 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java @@ -216,7 +216,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput @Override public final String readLine() throws IOException { - return new String(); + return ""; } /** @@ -226,7 +226,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput @Override public final String readUTF() throws IOException { - return new String(); + return ""; } /** @@ -235,7 +235,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput **/ public final static String readUTF(final DataInput in) throws IOException { - return new String(); + return ""; } } |