aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-07-23 00:54:59 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2013-07-23 00:54:59 +0200
commit1b4d8669c48af215c38a73f6dfd15741619a1c45 (patch)
tree0c6487d4aaf711e401450fbfa5a35f1f6eae3e8b /src/core/lombok/javac
parent45697b50816df79475a8bb69dc89ff68747fbfe6 (diff)
downloadlombok-1b4d8669c48af215c38a73f6dfd15741619a1c45.tar.gz
lombok-1b4d8669c48af215c38a73f6dfd15741619a1c45.tar.bz2
lombok-1b4d8669c48af215c38a73f6dfd15741619a1c45.zip
A source file with just @Getter in it now compiles in javac8, but there is still a looooong way to go.
Diffstat (limited to 'src/core/lombok/javac')
-rw-r--r--src/core/lombok/javac/JavacAST.java2
-rw-r--r--src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java2
-rw-r--r--src/core/lombok/javac/handlers/HandleSneakyThrows.java3
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java4
4 files changed, 6 insertions, 5 deletions
diff --git a/src/core/lombok/javac/JavacAST.java b/src/core/lombok/javac/JavacAST.java
index 36c51210..04d7540f 100644
--- a/src/core/lombok/javac/JavacAST.java
+++ b/src/core/lombok/javac/JavacAST.java
@@ -360,7 +360,7 @@ public class JavacAST extends AST<JavacAST, JavacNode, JCTree> {
void removeDeferredErrors(JavacNode node) {
DiagnosticPosition pos = node.get().pos();
JCCompilationUnit top = (JCCompilationUnit) top().get();
- removeFromDeferredDiagnostics(pos.getStartPosition(), pos.getEndPosition(top.endPositions));
+ removeFromDeferredDiagnostics(pos.getStartPosition(), Javac.getEndPosition(pos, top));
}
/** Supply either a position or a node (in that case, position of the node is used) */
diff --git a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java
index 741e7e21..f5f1bbd6 100644
--- a/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java
+++ b/src/core/lombok/javac/handlers/HandleEqualsAndHashCode.java
@@ -139,7 +139,7 @@ public class HandleEqualsAndHashCode extends JavacAnnotationHandler<EqualsAndHas
}
}
- JCTree extending = ((JCClassDecl)typeNode.get()).getExtendsClause();
+ JCTree extending = Javac.getExtendsClause((JCClassDecl)typeNode.get());
if (extending != null) {
String p = extending.toString();
isDirectDescendantOfObject = p.equals("Object") || p.equals("java.lang.Object");
diff --git a/src/core/lombok/javac/handlers/HandleSneakyThrows.java b/src/core/lombok/javac/handlers/HandleSneakyThrows.java
index c818f630..8172cf35 100644
--- a/src/core/lombok/javac/handlers/HandleSneakyThrows.java
+++ b/src/core/lombok/javac/handlers/HandleSneakyThrows.java
@@ -29,6 +29,7 @@ import java.util.Collections;
import lombok.SneakyThrows;
import lombok.core.AnnotationValues;
+import lombok.javac.Javac;
import lombok.javac.JavacAnnotationHandler;
import lombok.javac.JavacNode;
@@ -121,7 +122,7 @@ public class HandleSneakyThrows extends JavacAnnotationHandler<SneakyThrows> {
JCVariableDecl catchParam = maker.VarDef(maker.Modifiers(Flags.FINAL), node.toName("$ex"), varType, null);
JCExpression lombokLombokSneakyThrowNameRef = chainDots(node, "lombok", "Lombok", "sneakyThrow");
- JCBlock catchBody = maker.Block(0, List.<JCStatement>of(maker.Throw(maker.Apply(
+ JCBlock catchBody = maker.Block(0, List.<JCStatement>of(Javac.makeThrow(maker, maker.Apply(
List.<JCExpression>nil(), lombokLombokSneakyThrowNameRef,
List.<JCExpression>of(maker.Ident(node.toName("$ex")))))));
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index 211f5d36..a9c47e78 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -946,8 +946,8 @@ public class JavacHandlerUtil {
if (isPrimitive(varDecl.vartype)) return null;
Name fieldName = varDecl.name;
JCExpression npe = chainDots(variable, "java", "lang", "NullPointerException");
- JCTree exception = maker.NewClass(null, List.<JCExpression>nil(), npe, List.<JCExpression>of(maker.Literal(fieldName.toString())), null);
- JCStatement throwStatement = maker.Throw(exception);
+ JCExpression exception = maker.NewClass(null, List.<JCExpression>nil(), npe, List.<JCExpression>of(maker.Literal(fieldName.toString())), null);
+ JCStatement throwStatement = Javac.makeThrow(maker, exception);
JCBlock throwBlock = maker.Block(0, List.of(throwStatement));
return maker.If(Javac.makeBinary(maker, CTC_EQUAL, maker.Ident(fieldName), Javac.makeLiteral(maker, CTC_BOT, null)), throwBlock, null);
}