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:
Reinier Zwitserloot committed 2009-07-03 16:01:14 +02:00
1 parent c3e4ed5d78
commit cf594564be
4 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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() ) {
+1 -1
View File
@@ -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 ) {