diff options
author | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-17 20:05:19 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@tipit.to> | 2009-06-17 20:05:19 +0200 |
commit | af27ad5395b006a174ad86ed40074279b57d9411 (patch) | |
tree | c7d7d1ef67402096ffbd7ef139d91aae21f38a94 /src | |
parent | 0c9897303f97fba2d2f626ebfd4ef4a1fbc78699 (diff) | |
download | lombok-af27ad5395b006a174ad86ed40074279b57d9411.tar.gz lombok-af27ad5395b006a174ad86ed40074279b57d9411.tar.bz2 lombok-af27ad5395b006a174ad86ed40074279b57d9411.zip |
Error reporting now works 99% properly - the right position is being marked off. The only issue is that the count by javac is being misreported (it doesn't count lombok errors).
Diffstat (limited to 'src')
-rw-r--r-- | src/lombok/javac/HandlerLibrary.java | 5 | ||||
-rw-r--r-- | src/lombok/javac/JavacAST.java | 10 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/lombok/javac/HandlerLibrary.java b/src/lombok/javac/HandlerLibrary.java index 51bc0f52..d816438e 100644 --- a/src/lombok/javac/HandlerLibrary.java +++ b/src/lombok/javac/HandlerLibrary.java @@ -32,7 +32,6 @@ import com.sun.tools.javac.tree.JCTree.JCIdent; import com.sun.tools.javac.tree.JCTree.JCLiteral; import com.sun.tools.javac.tree.JCTree.JCNewArray; import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; -import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition; public class HandlerLibrary { @@ -89,12 +88,12 @@ public class HandlerLibrary { for ( JCExpression inner : elems ) { raws.add(inner.toString()); guesses.add(calculateGuess(inner)); - positions.add(new SimpleDiagnosticPosition(inner.pos)); + positions.add(inner.pos()); } } else { raws.add(rhs.toString()); guesses.add(calculateGuess(rhs)); - positions.add(new SimpleDiagnosticPosition(rhs.pos)); + positions.add(rhs.pos()); } } diff --git a/src/lombok/javac/JavacAST.java b/src/lombok/javac/JavacAST.java index 872da3d9..37673ab5 100644 --- a/src/lombok/javac/JavacAST.java +++ b/src/lombok/javac/JavacAST.java @@ -338,12 +338,10 @@ public class JavacAST extends AST<JCTree> { JavaFileObject newSource = null; JCTree astObject = node == null ? null : node.get(); JCCompilationUnit top = (JCCompilationUnit) top().get(); - if (node != null) { - newSource = top.sourcefile; - if (newSource != null) { - oldSource = log.useSource(newSource); - pos = astObject.pos(); - } + newSource = top.sourcefile; + if (newSource != null) { + oldSource = log.useSource(newSource); + if ( pos == null ) pos = astObject.pos(); } try { switch (kind) { |