diff --git a/engine/src/core-plugins/com/jme3/font/plugins/BitmapFontLoader.java b/engine/src/core-plugins/com/jme3/font/plugins/BitmapFontLoader.java index 5c4e89fc1..93d8bb5f0 100644 --- a/engine/src/core-plugins/com/jme3/font/plugins/BitmapFontLoader.java +++ b/engine/src/core-plugins/com/jme3/font/plugins/BitmapFontLoader.java @@ -43,23 +43,22 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import org.omg.PortableInterceptor.SYSTEM_EXCEPTION; public class BitmapFontLoader implements AssetLoader { private BitmapFont load(AssetManager assetManager, String folder, InputStream in) throws IOException{ MaterialDef spriteMat = (MaterialDef) assetManager.loadAsset(new AssetKey("Common/MatDefs/Misc/Unshaded.j3md")); - BitmapCharacterSet charSet = new BitmapCharacterSet(); Material[] matPages = null; BitmapFont font = new BitmapFont(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - String regex = "[\\s=]+"; - + String regex = "[\\s=]+"; font.setCharSet(charSet); - while (reader.ready()){ - String line = reader.readLine(); + String line; + while ((line = reader.readLine())!=null){ String[] tokens = line.split(regex); if (tokens[0].equals("info")){ // Get rendered size diff --git a/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java b/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java index ce891df4b..fbd4d4b95 100644 --- a/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java +++ b/engine/src/core-plugins/com/jme3/shader/plugins/GLSLLoader.java @@ -82,8 +82,8 @@ public class GLSLLoader implements AssetLoader { StringBuilder sb = new StringBuilder(); BufferedReader bufReader = new BufferedReader(reader); try { - while (bufReader.ready()) { - String ln = bufReader.readLine(); + String ln; + while ((ln = bufReader.readLine()) != null) { if (ln.trim().startsWith("#import ")) { ln = ln.trim().substring(8).trim(); if (ln.startsWith("\"") && ln.endsWith("\"") && ln.length() > 3) {