diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lombok/core/AST.java | 4 | ||||
-rw-r--r-- | src/lombok/eclipse/handlers/PKG.java | 2 | ||||
-rw-r--r-- | src/lombok/javac/JavacAST.java | 4 | ||||
-rw-r--r-- | src/lombok/javac/handlers/HandleData.java | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/lombok/core/AST.java b/src/lombok/core/AST.java index 2f92ad6d..24e128b2 100644 --- a/src/lombok/core/AST.java +++ b/src/lombok/core/AST.java @@ -156,8 +156,8 @@ public abstract class AST<N> { * @see #isStructurallySignificant() */ public Node up() { - Node result = (Node)parent; - while ( result != null && !result.isStructurallySignificant ) result = (Node)result.parent; + Node result = parent; + while ( result != null && !result.isStructurallySignificant ) result = result.parent; return result; } diff --git a/src/lombok/eclipse/handlers/PKG.java b/src/lombok/eclipse/handlers/PKG.java index 13492b28..697514a7 100644 --- a/src/lombok/eclipse/handlers/PKG.java +++ b/src/lombok/eclipse/handlers/PKG.java @@ -133,7 +133,7 @@ class PKG { if ( node.get() instanceof TypeDeclaration ) { for ( AbstractMethodDeclaration def : ((TypeDeclaration)node.get()).methods ) { - char[] mName = ((AbstractMethodDeclaration)def).selector; + char[] mName = def.selector; if ( mName == null ) continue; if ( methodName.equals(new String(mName)) ) { EclipseAST.Node existing = node.getNodeFor(def); diff --git a/src/lombok/javac/JavacAST.java b/src/lombok/javac/JavacAST.java index 4c8c2f78..4eecbc68 100644 --- a/src/lombok/javac/JavacAST.java +++ b/src/lombok/javac/JavacAST.java @@ -269,9 +269,9 @@ public class JavacAST extends AST<JCTree> { visitor.endVisitLocal(this, (JCVariableDecl)get()); break; case STATEMENT: - visitor.visitStatement(this, (JCTree)get()); + visitor.visitStatement(this, get()); traverseChildren(visitor, this); - visitor.endVisitStatement(this, (JCTree)get()); + visitor.endVisitStatement(this, get()); break; case ANNOTATION: switch ( up().getKind() ) { diff --git a/src/lombok/javac/handlers/HandleData.java b/src/lombok/javac/handlers/HandleData.java index ddd9755c..5da08759 100644 --- a/src/lombok/javac/handlers/HandleData.java +++ b/src/lombok/javac/handlers/HandleData.java @@ -43,7 +43,7 @@ public class HandleData implements JavacAnnotationHandler<Data> { Node typeNode = annotationNode.up(); JCClassDecl typeDecl = null; if ( typeNode.get() instanceof JCClassDecl ) typeDecl = (JCClassDecl)typeNode.get(); - long flags = typeDecl.mods.flags; + long flags = typeDecl == null ? 0 : typeDecl.mods.flags; boolean notAClass = (flags & (Flags.INTERFACE | Flags.ENUM | Flags.ANNOTATION)) != 0; if ( typeDecl == null || notAClass ) { |