From 946e0b59847de43d3dd51080abe7b9703d431e5f Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Fri, 18 Oct 2013 07:55:37 -0700 Subject: jogl: replce more unneeded String() construction Signed-off-by: Harvey Harrison --- .../classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java | 2 +- .../classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java | 9 ++++----- .../classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java index 4903e6acd..44fbf1c6d 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java +++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java @@ -137,7 +137,7 @@ public abstract class CompileShader { } String dirname; if (lastSlash < 0) { - dirname = new String(); + dirname = ""; } else { dirname = path.substring(0, lastSlash + 1); } diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java index 24198703a..05a94def8 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java @@ -183,16 +183,15 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl { } private String replaceAll(String orig, String search, String repl) { - String dest=null; + StringBuilder dest = new StringBuilder(); // In case replaceAll / java.util.regex.* is not supported (-> CVM) int i=0,j; - dest = new String(); while((j=orig.indexOf(search, i))>=0) { - dest=dest.concat(orig.substring(i, j)); - dest=dest.concat(repl); + dest.append(orig.substring(i, j)); + dest.append(repl); i=j+1; } - return dest.concat(orig.substring(i, orig.length())); + return dest.append(orig.substring(i, orig.length())).toString(); } private void errorCheckEGL(String s) { diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java index c02fc0a04..eeec66376 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java @@ -70,9 +70,9 @@ public final class DirectDataBufferInt extends DataBuffer { @Override public String toString() { - return new String("BufferedImageInt@"+Integer.toHexString(hashCode()) - +": custom/internal type = "+customImageType+"/"+getType() - +" "+getColorModel()+" "+getRaster()); + return "BufferedImageInt@"+Integer.toHexString(hashCode()) + +": custom/internal type = "+customImageType+"/"+getType() + +" "+getColorModel()+" "+getRaster(); } } -- cgit v1.2.3