From 1b0d0ff5ad539f34fc27a8a27621b3f8d6d982b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 18 Oct 2009 15:12:41 +0200 Subject: Configured warnings and solved some. --- src/lombok/javac/JavacAST.java | 19 +++++++++---------- src/lombok/javac/JavacNode.java | 10 +++++----- src/lombok/javac/apt/Processor.java | 14 +++++++------- 3 files changed, 21 insertions(+), 22 deletions(-) (limited to 'src/lombok/javac') diff --git a/src/lombok/javac/JavacAST.java b/src/lombok/javac/JavacAST.java index eea1bad9..77e365ee 100644 --- a/src/lombok/javac/JavacAST.java +++ b/src/lombok/javac/JavacAST.java @@ -251,6 +251,7 @@ public class JavacAST extends AST { } /** For javac, both JCExpression and JCStatement are considered as valid children types. */ + @Override protected Collection> getStatementTypes() { Collection> collection = new ArrayList>(2); collection.add(JCStatement.class); @@ -305,11 +306,9 @@ public class JavacAST extends AST { com.sun.tools.javac.util.List oldL = (com.sun.tools.javac.util.List) current; com.sun.tools.javac.util.List newL = replaceInConsList(oldL, oldO, newO); if (chain.isEmpty()) return newL; - else { - List> reducedChain = new ArrayList>(chain); - Collection newCurrent = reducedChain.remove(reducedChain.size() -1); - return setElementInConsList(reducedChain, newCurrent, oldL, newL); - } + List> reducedChain = new ArrayList>(chain); + Collection newCurrent = reducedChain.remove(reducedChain.size() -1); + return setElementInConsList(reducedChain, newCurrent, oldL, newL); } private com.sun.tools.javac.util.List replaceInConsList(com.sun.tools.javac.util.List oldL, Object oldO, Object newO) { @@ -323,16 +322,16 @@ public class JavacAST extends AST { } if (repl) return com.sun.tools.javac.util.List.from(a); - else return oldL; + return oldL; } - private void increaseErrorCount(Messager messager) { + private void increaseErrorCount(Messager m) { try { - Field f = messager.getClass().getDeclaredField("errorCount"); + Field f = m.getClass().getDeclaredField("errorCount"); f.setAccessible(true); if (f.getType() == int.class) { - int val = ((Number)f.get(messager)).intValue(); - f.set(messager, val +1); + int val = ((Number)f.get(m)).intValue(); + f.set(m, val +1); } } catch (Throwable t) { //Very unfortunate, but in most cases it still works fine, so we'll silently swallow it. diff --git a/src/lombok/javac/JavacNode.java b/src/lombok/javac/JavacNode.java index 004aff19..46e06579 100644 --- a/src/lombok/javac/JavacNode.java +++ b/src/lombok/javac/JavacNode.java @@ -81,10 +81,10 @@ public class JavacNode extends lombok.core.LombokNode