diff --git a/src/java/com/threerings/jme/StatsDisplay.java b/src/java/com/threerings/jme/StatsDisplay.java index 7db52c44..2fe5df26 100644 --- a/src/java/com/threerings/jme/StatsDisplay.java +++ b/src/java/com/threerings/jme/StatsDisplay.java @@ -71,11 +71,11 @@ public class StatsDisplay extends Node _stats.setLength(0); _stats.append("FPS: ").append((int)timer.getFrameRate()); _stats.append(" - ").append(renderer.getStatistics(_temp)); - _text.print(_stats); + _text.print(_stats.toString()); } protected Text _text; - protected StringBuffer _stats = new StringBuffer(); + protected StringBuilder _stats = new StringBuilder(); protected StringBuffer _temp = new StringBuffer(); protected static final String DEFAULT_JME_FONT = diff --git a/src/java/com/threerings/jme/util/ShaderCache.java b/src/java/com/threerings/jme/util/ShaderCache.java index 63d77716..3f799008 100644 --- a/src/java/com/threerings/jme/util/ShaderCache.java +++ b/src/java/com/threerings/jme/util/ShaderCache.java @@ -186,7 +186,7 @@ public class ShaderCache // fetch the shader source String source = _sources.get(shader); if (source == null) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); try { BufferedReader reader = new BufferedReader( new InputStreamReader(_rsrcmgr.getResource(shader))); @@ -202,7 +202,7 @@ public class ShaderCache } // prepend the definitions (the version directive comes before anything else) - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("#version 110\n"); for (String def : defs) { buf.append("#define ").append(def).append('\n'); diff --git a/src/java/com/threerings/jme/util/ShaderConfig.java b/src/java/com/threerings/jme/util/ShaderConfig.java index 6dcec802..897cbda7 100644 --- a/src/java/com/threerings/jme/util/ShaderConfig.java +++ b/src/java/com/threerings/jme/util/ShaderConfig.java @@ -235,7 +235,7 @@ public abstract class ShaderConfig protected void getDerivedDefinitions (ArrayList ddefs) { // add the def that sets the front color based on the light types - StringBuffer buf = new StringBuffer("SET_FRONT_COLOR "); + StringBuilder buf = new StringBuilder("SET_FRONT_COLOR "); if (_lights != null) { // start with the "scene color," which combines scene ambient, emissivity, etc. buf.append("vec3 frontColor = gl_FrontLightModelProduct.sceneColor.rgb; "); @@ -254,7 +254,7 @@ public abstract class ShaderConfig ddefs.add(buf.toString()); // add the def that sets the texture coordinates based on the env map modes - buf = new StringBuffer("SET_TEX_COORDS"); + buf = new StringBuilder("SET_TEX_COORDS"); if (_textures != null) { for (int ii = 0; ii < _textures.length; ii++) { TextureConfig texture = _textures[ii]; @@ -272,7 +272,7 @@ public abstract class ShaderConfig ddefs.add(buf.toString()); // add the definition that sets the fog alpha based on the density function - buf = new StringBuffer("SET_FOG_ALPHA"); + buf = new StringBuilder("SET_FOG_ALPHA"); if (_fogDensityFunc == FogState.DF_EXP) { buf.append(" fogAlpha = exp(gl_Fog.density * eyeVertex.z);"); }