diff options
author | Sven Gothel <[email protected]> | 2012-04-16 00:50:14 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-04-16 00:50:14 +0200 |
commit | ffb47c6610fc742926abc946fc14d12ee9c65a9a (patch) | |
tree | 36b157a02c244375ec26658d0444bb8d3b0e3380 /src/jogl/classes/com | |
parent | ace2daf725dfc1aa700338fae71fe93a9d0fd865 (diff) |
StringBuffer -> StringBuilder (Local objects, no concurrency) ; Impacts: Capabilities/GLContext API 'toString(StringBuilder)'
Diffstat (limited to 'src/jogl/classes/com')
5 files changed, 8 insertions, 9 deletions
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java index f3d0d37b1..1d9cf3668 100644 --- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java +++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java @@ -564,7 +564,7 @@ public class BuildComposablePipeline { */ protected void postMethodEmissionHook(PrintWriter output) { output.println(" public String toString() {"); - output.println(" StringBuffer sb = new StringBuffer();"); + output.println(" StringBuilder sb = new StringBuilder();"); output.println(" sb.append(\"" + getOutputName() + " [ implementing " + baseInterfaceClass.getName() + ",\\n\\t\");"); if (null != prologClassOpt) { output.println(" sb.append(\" prolog: \"+" + getPrologObjectNameOpt() + ".toString()+\",\\n\\t\");"); @@ -859,7 +859,7 @@ public class BuildComposablePipeline { + ".glGetError();"); output.println(" if (err == GL_NO_ERROR) { return; }"); output.println(); - output.println(" StringBuffer buf = new StringBuffer(Thread.currentThread()+"); + output.println(" StringBuilder buf = new StringBuilder(Thread.currentThread()+"); output.println(" \" glGetError() returned the following error codes after a call to \" + caller + \": \");"); output.println(); output.println(" // Loop repeatedly to allow for distributed GL implementations,"); @@ -1010,7 +1010,7 @@ public class BuildComposablePipeline { output.println("protected String dumpArray(Object obj)"); output.println("{"); output.println(" if (obj == null) return \"[null]\";"); - output.println(" StringBuffer sb = new StringBuffer(\"[\");"); + output.println(" StringBuilder sb = new StringBuilder(\"[\");"); output.println(" int len = java.lang.reflect.Array.getLength(obj);"); output.println(" int count = Math.min(len,16);"); output.println(" for ( int i =0; i < count; i++ ) {"); diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java index 44026fdac..3b817afcf 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java +++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java @@ -70,7 +70,7 @@ public class ImmModeSink { } public String toString() { - StringBuffer sb = new StringBuffer("ImmModeSink["); + StringBuilder sb = new StringBuilder("ImmModeSink["); sb.append(",\n\tVBO list: "+vboSetList.size()+" ["); for(Iterator<VBOSet> i=vboSetList.iterator(); i.hasNext() ; ) { sb.append("\n\t"); 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 4318e1244..622ee1b79 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java @@ -1603,7 +1603,7 @@ public class TextRenderer { } else { // Assemble a run of characters that don't fit in // the cache - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); while (i < lengthInGlyphs && getGlyph(inString, fullRunGlyphVector.getGlyphMetrics(i), i) == null) { buf.append(inString.charAt(i++)); 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 cf3e764d0..a5b1c6687 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 @@ -3,7 +3,6 @@ package com.jogamp.opengl.util.glsl.sdk; import com.jogamp.common.util.IOUtil; import javax.media.opengl.*; -import com.jogamp.opengl.util.*; import com.jogamp.opengl.util.glsl.*; import java.io.*; @@ -68,7 +67,7 @@ public abstract class CompileShader { URL resourceURL = IOUtil.getResource(null, resourceName).getURL(); String dirName = dirname(resourceURL.getPath()); - String shader = ShaderCode.readShaderSource(null, resourceName); + CharSequence shader = ShaderCode.readShaderSource(null, resourceName, false); if(null==shader) { System.err.println("Can't find shader source " + resourceName + " - ignored"); return; @@ -93,7 +92,7 @@ public abstract class CompileShader { tmpDir.mkdirs(); File tmpFile = new File(tmpDir, justName); Writer writer = new BufferedWriter(new FileWriter(tmpFile)); - writer.write(shader, 0, shader.length()); + writer.write(shader.toString(), 0, shader.length()); writer.flush(); writer.close(); System.err.println("Preprocessed: "+ tmpFile.getAbsolutePath()); diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java index 306e7d2fe..3f91ae966 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java @@ -472,7 +472,7 @@ public class DDSImage { @return String format code */ public static String getCompressionFormatName(int compressionFormat) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (int i = 0; i < 4; i++) { char c = (char) (compressionFormat & 0xFF); buf.append(c); |