diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:06:47 +0200 |
commit | df9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch) | |
tree | 239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java | |
parent | eb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java')
-rw-r--r-- | src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java b/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java index c7e3635..7583d50 100644 --- a/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java +++ b/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java @@ -48,20 +48,20 @@ public class ConcatenatingReader extends FilterReader { // Any leftover characters go here private char[] curBuf; private int curPos; - private BufferedReader reader; + private final BufferedReader reader; private static String newline = System.getProperty("line.separator"); /** This class requires that the input reader be a BufferedReader so it can do line-oriented operations. */ - public ConcatenatingReader(BufferedReader in) { + public ConcatenatingReader(final BufferedReader in) { super(in); this.reader = in; } @Override public int read() throws IOException { - char[] tmp = new char[1]; - int num = read(tmp, 0, 1); + final char[] tmp = new char[1]; + final int num = read(tmp, 0, 1); if (num < 0) return -1; return tmp[0]; @@ -74,7 +74,7 @@ public class ConcatenatingReader extends FilterReader { } @Override - public void mark(int readAheadLimit) throws IOException { + public void mark(final int readAheadLimit) throws IOException { throw new IOException("mark/reset not supported"); } @@ -91,7 +91,7 @@ public class ConcatenatingReader extends FilterReader { } @Override - public int read(char[] cbuf, int off, int len) throws IOException { + public int read(final char[] cbuf, int off, int len) throws IOException { if (curBuf == null) { nextLine(); } @@ -121,9 +121,9 @@ public class ConcatenatingReader extends FilterReader { long numSkipped = 0; while (n > 0) { - int intN = (int) n; - char[] tmp = new char[intN]; - int numRead = read(tmp, 0, intN); + final int intN = (int) n; + final char[] tmp = new char[intN]; + final int numRead = read(tmp, 0, intN); n -= numRead; numSkipped += numRead; if (numRead < intN) @@ -133,7 +133,7 @@ public class ConcatenatingReader extends FilterReader { } private void nextLine() throws IOException { - String cur = reader.readLine(); + final String cur = reader.readLine(); if (cur == null) { curBuf = null; return; @@ -148,7 +148,7 @@ public class ConcatenatingReader extends FilterReader { --numChars; needNewline = false; } - char[] buf = new char[numChars + (needNewline ? newline.length() : 0)]; + final char[] buf = new char[numChars + (needNewline ? newline.length() : 0)]; cur.getChars(0, numChars, buf, 0); if (needNewline) { newline.getChars(0, newline.length(), buf, numChars); |