aboutsummaryrefslogtreecommitdiff
path: root/src/lombok/javac
diff options
context:
space:
mode:
Diffstat (limited to 'src/lombok/javac')
-rw-r--r--src/lombok/javac/HandlerLibrary.java5
-rw-r--r--src/lombok/javac/JavacAST.java10
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) {