mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 08:15:48 +00:00
Fine-tuning eclipse's error reporting found some minor issues and even 1 bug that would show up rarely or not at all.
This commit is contained in:
1 parent
c3e4ed5d78
commit
cf594564be
4 files changed
+6
-6
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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() ) {
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
Reference in new issue
Block a user