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/jgram | |
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/jgram')
-rw-r--r-- | src/java/com/jogamp/gluegen/jgram/Test.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/java/com/jogamp/gluegen/jgram/Test.java b/src/java/com/jogamp/gluegen/jgram/Test.java index 19d2110..2e41ef6 100644 --- a/src/java/com/jogamp/gluegen/jgram/Test.java +++ b/src/java/com/jogamp/gluegen/jgram/Test.java @@ -10,7 +10,7 @@ import java.util.Set; class Test { static boolean showTree = false; - public static void main(String[] args) { + public static void main(final String[] args) { // Use a try/catch block for parser exceptions try { // if we have at least one command-line argument @@ -30,7 +30,7 @@ class Test { System.err.println("Usage: java com.jogamp.gluegen.jgram.Test [-showtree] "+ "<directory or file name>"); } - catch(Exception e) { + catch(final Exception e) { System.err.println("exception: "+e); e.printStackTrace(System.err); // so we can get stack trace } @@ -39,11 +39,11 @@ class Test { // This method decides what action to take based on the type of // file we are looking at - public static void doFile(File f) + public static void doFile(final File f) throws Exception { // If this is a directory, walk each file/dir in that directory if (f.isDirectory()) { - String files[] = f.list(); + final String files[] = f.list(); for(int i=0; i < files.length; i++) doFile(new File(f, files[i])); } @@ -58,15 +58,15 @@ class Test { } // Here's where we do the real work... - public static void parseFile(String f, Reader r) + public static void parseFile(final String f, final Reader r) throws Exception { try { // Create a scanner that reads from the input stream passed to us - JavaLexer lexer = new JavaLexer(r); + final JavaLexer lexer = new JavaLexer(r); lexer.setFilename(f); // Create a parser that reads from the scanner - JavaParser parser = new JavaParser(lexer); + final JavaParser parser = new JavaParser(lexer); parser.setFilename(f); // start parsing at the compilationUnit rule @@ -74,21 +74,21 @@ class Test { Set<String> set = parser.getParsedEnumNames(); System.out.println("Enums"); - for(Iterator<String> iter = set.iterator(); iter.hasNext(); ) { - String s = iter.next(); + for(final Iterator<String> iter = set.iterator(); iter.hasNext(); ) { + final String s = iter.next(); System.out.println(s); } System.out.println("Functions"); set = parser.getParsedFunctionNames(); - for(Iterator<String> iter = set.iterator(); iter.hasNext(); ) { - String s = iter.next(); + for(final Iterator<String> iter = set.iterator(); iter.hasNext(); ) { + final String s = iter.next(); System.out.println(s); } // do something with the tree //doTreeAction(f, parser.getAST(), parser.getTokenNames()); } - catch (Exception e) { + catch (final Exception e) { System.err.println("parser exception: "+e); e.printStackTrace(); // so we can get stack trace } |