### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java,v retrieving revision 1.3 diff -u -r1.3 ASTImplTests.java --- src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java 27 Jun 2006 09:05:37 -0000 1.3 +++ src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java 13 Oct 2006 18:13:45 -0000 @@ -21,12 +21,19 @@ import org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.eclipse.jdt.internal.compiler.ast.CombinedBinaryExpression; import org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral; +import org.eclipse.jdt.internal.compiler.ast.JavadocSingleTypeReference; +import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation; +import org.eclipse.jdt.internal.compiler.ast.MemberValuePair; +import org.eclipse.jdt.internal.compiler.ast.NormalAnnotation; +import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation; import org.eclipse.jdt.internal.compiler.ast.SingleNameReference; import org.eclipse.jdt.internal.compiler.ast.StringLiteral; import org.eclipse.jdt.internal.compiler.ast.StringLiteralConcatenation; import org.eclipse.jdt.internal.compiler.batch.CompilationUnit; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; +import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.parser.Parser; import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; import org.eclipse.jdt.internal.compiler.problem.ProblemReporter; @@ -735,6 +742,82 @@ CombinedBinaryExpression.defaultArityMaxStartingValue = CombinedBinaryExpression.ARITY_MAX_MIN; } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157170 +public void test0017() { + CompilerOptions options = new CompilerOptions(); + options.complianceLevel = ClassFileConstants.JDK1_5; + options.sourceLevel = ClassFileConstants.JDK1_5; + options.targetJDK = ClassFileConstants.JDK1_5; + this.runConformTest( + "X.java", + "@interface Annot {\n" + + " int value() default 0;\n" + + "}\n" + + "@Annot\n" + + "@Annot(3)\n" + + "@Annot(value=4)\n" + + "public class X {\n" + + "}\n", + new Parser( + new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), + options, + new DefaultProblemFactory()), false), + new AnnotationCollector(), + "marker annotation start visit\n" + + "marker annotation end visit\n" + + "single member annotation start visit\n" + + "3\n" + + "single member annotation end visit\n" + + "normal annotation start visit\n" + + "member value pair start visit\n" + + "value, 4\n" + + "member value pair end visit\n" + + "normal annotation end visit\n"); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=157170 +public void test0018() { + CompilerOptions options = new CompilerOptions(); + options.complianceLevel = ClassFileConstants.JDK1_5; + options.sourceLevel = ClassFileConstants.JDK1_5; + options.targetJDK = ClassFileConstants.JDK1_5; + options.docCommentSupport = true; + this.runConformTest( + "X.java", + "@interface Annot {\n" + + " int value() default 0;\n" + + "}\n" + + "/**\n" + + " * @see Annot\n" + + " */\n" + + "@Annot\n" + + "@Annot(3)\n" + + "@Annot(value=4)\n" + + "public class X {\n" + + " /**\n" + + " * @see Annot\n" + + " */\n" + + " public void foo() {}\n" + + "}\n", + new Parser( + new ProblemReporter(DefaultErrorHandlingPolicies.proceedWithAllProblems(), + options, + new DefaultProblemFactory()), false), + new AnnotationCollector(), + "java doc single type reference start visit\n" + + "java doc single type reference end visit\n" + + "marker annotation start visit\n" + + "marker annotation end visit\n" + + "single member annotation start visit\n" + + "3\n" + + "single member annotation end visit\n" + + "normal annotation start visit\n" + + "member value pair start visit\n" + + "value, 4\n" + + "member value pair end visit\n" + + "normal annotation end visit\n" + + "java doc single type reference start visit\n" + + "java doc single type reference end visit\n"); +} } // Helper classes: define visitors leveraged by some tests @@ -824,4 +907,54 @@ this.collector.append("[v SLC " + cut(literal.toString()) + "]\n"); return super.visit(literal, scope); } +} +class AnnotationCollector extends ASTCollector { +public boolean visit(MarkerAnnotation annotation, ClassScope scope) { + this.collector.append("marker annotation start visit\n"); + return super.visit(annotation, scope); +} +public void endVisit(MarkerAnnotation annotation, ClassScope scope) { + this.collector.append("marker annotation end visit\n"); +} +public boolean visit(NormalAnnotation annotation, ClassScope scope) { + this.collector.append("normal annotation start visit\n"); + return super.visit(annotation, scope); +} +public void endVisit(NormalAnnotation annotation, ClassScope scope) { + this.collector.append("normal annotation end visit\n"); +} +public boolean visit(SingleMemberAnnotation annotation, ClassScope scope) { + this.collector.append("single member annotation start visit\n"); + this.collector.append(annotation.memberValue.toString()); + this.collector.append("\n"); + return super.visit(annotation, scope); +} +public void endVisit(SingleMemberAnnotation annotation, ClassScope scope) { + this.collector.append("single member annotation end visit\n"); +} +public void endVisit(JavadocSingleTypeReference typeRef, BlockScope scope) { + this.collector.append("java doc single type reference end visit\n"); +} +public void endVisit(JavadocSingleTypeReference typeRef, ClassScope scope) { + this.collector.append("java doc single type reference end visit\n"); +} +public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) { + this.collector.append("java doc single type reference start visit\n"); + return true; +} +public boolean visit(JavadocSingleTypeReference typeRef, ClassScope scope) { + this.collector.append("java doc single type reference start visit\n"); + return true; +} +public boolean visit(MemberValuePair pair, ClassScope scope) { + this.collector.append("member value pair start visit\n"); + this.collector.append(pair.name); + this.collector.append(", "); + this.collector.append(pair.value.toString()); + this.collector.append("\n"); + return super.visit(pair, scope); +} +public void endVisit(MemberValuePair pair, ClassScope scope) { + this.collector.append("member value pair end visit\n"); +} } \ No newline at end of file #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java,v retrieving revision 1.63 diff -u -r1.63 AllocationExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 28 Mar 2006 20:29:57 -0000 1.63 +++ compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java 13 Oct 2006 18:13:45 -0000 @@ -340,4 +340,21 @@ } visitor.endVisit(this, scope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + if (this.typeArguments != null) { + for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) { + this.typeArguments[i].traverse(visitor, scope); + } + } + if (this.type != null) { // enum constant scenario + this.type.traverse(visitor, scope); + } + if (this.arguments != null) { + for (int i = 0, argumentsLength = this.arguments.length; i < argumentsLength; i++) + this.arguments[i].traverse(visitor, scope); + } + } + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/NullLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NullLiteral.java,v retrieving revision 1.17 diff -u -r1.17 NullLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/NullLiteral.java 28 Mar 2006 20:29:56 -0000 1.17 +++ compiler/org/eclipse/jdt/internal/compiler/ast/NullLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -65,4 +65,8 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java,v retrieving revision 1.105 diff -u -r1.105 Expression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 5 Sep 2006 13:50:57 -0000 1.105 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java 13 Oct 2006 18:13:46 -0000 @@ -952,12 +952,9 @@ return this; } public void traverse(ASTVisitor visitor, BlockScope scope) { - // do nothing by default + // nothing to do } public void traverse(ASTVisitor visitor, ClassScope scope) { - // do nothing by default - } - public void traverse(ASTVisitor visitor, CompilationUnitScope scope) { - // do nothing by default + // nothing to do } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java,v retrieving revision 1.90 diff -u -r1.90 SingleNameReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 28 Sep 2006 13:07:21 -0000 1.90 +++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java 13 Oct 2006 18:13:46 -0000 @@ -854,11 +854,15 @@ } public void traverse(ASTVisitor visitor, BlockScope scope) { - visitor.visit(this, scope); visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } + public String unboundReferenceErrorName(){ return new String(token); Index: compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java,v retrieving revision 1.16 diff -u -r1.16 CharLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java 28 Mar 2006 20:29:56 -0000 1.16 +++ compiler/org/eclipse/jdt/internal/compiler/ast/CharLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -97,4 +97,8 @@ visitor.visit(this, blockScope); visitor.endVisit(this, blockScope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java,v retrieving revision 1.7 diff -u -r1.7 MarkerAnnotation.java --- compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java 23 Feb 2005 02:47:28 -0000 1.7 +++ compiler/org/eclipse/jdt/internal/compiler/ast/MarkerAnnotation.java 13 Oct 2006 18:13:46 -0000 @@ -38,7 +38,7 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } - public void traverse(ASTVisitor visitor, CompilationUnitScope scope) { + public void traverse(ASTVisitor visitor, ClassScope scope) { visitor.visit(this, scope); visitor.endVisit(this, scope); } Index: compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java,v retrieving revision 1.55 diff -u -r1.55 MethodDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java 28 Mar 2006 20:29:56 -0000 1.55 +++ compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java 13 Oct 2006 18:13:46 -0000 @@ -184,6 +184,9 @@ ClassScope classScope) { if (visitor.visit(this, classScope)) { + if (this.javadoc != null) { + this.javadoc.traverse(visitor, scope); + } if (this.annotations != null) { int annotationsLength = this.annotations.length; for (int i = 0; i < annotationsLength; i++) Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java,v retrieving revision 1.11 diff -u -r1.11 JavadocReturnStatement.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java 28 Mar 2006 20:29:57 -0000 1.11 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java 13 Oct 2006 18:13:46 -0000 @@ -59,4 +59,12 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } + /* (non-Javadoc) + * Redefine to capture javadoc specific signatures + * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope) + */ + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java,v retrieving revision 1.43 diff -u -r1.43 ArrayInitializer.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 28 Mar 2006 20:29:56 -0000 1.43 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java 13 Oct 2006 18:13:45 -0000 @@ -228,4 +228,15 @@ } visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + + if (visitor.visit(this, scope)) { + if (this.expressions != null) { + int expressionsLength = this.expressions.length; + for (int i = 0; i < expressionsLength; i++) + this.expressions[i].traverse(visitor, scope); + } + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java,v retrieving revision 1.60 diff -u -r1.60 BinaryExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java 26 Jun 2006 14:47:42 -0000 1.60 +++ compiler/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java 13 Oct 2006 18:13:46 -0000 @@ -1898,4 +1898,11 @@ } visitor.endVisit(this, scope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + this.left.traverse(visitor, scope); + this.right.traverse(visitor, scope); + } + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java,v retrieving revision 1.27 diff -u -r1.27 JavadocMessageSend.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 9 Oct 2006 17:28:54 -0000 1.27 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java 13 Oct 2006 18:13:46 -0000 @@ -222,4 +222,21 @@ } visitor.endVisit(this, blockScope); } + /* (non-Javadoc) + * Redefine to capture javadoc specific signatures + * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope) + */ + public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + if (this.receiver != null) { + this.receiver.traverse(visitor, scope); + } + if (this.arguments != null) { + int argumentsLength = this.arguments.length; + for (int i = 0; i < argumentsLength; i++) + this.arguments[i].traverse(visitor, scope); + } + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java,v retrieving revision 1.17 diff -u -r1.17 JavadocArgumentExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java 10 May 2006 18:03:43 -0000 1.17 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java 13 Oct 2006 18:13:46 -0000 @@ -93,4 +93,12 @@ } visitor.endVisit(this, blockScope); } + public void traverse(ASTVisitor visitor, ClassScope blockScope) { + if (visitor.visit(this, blockScope)) { + if (this.argument != null) { + this.argument.traverse(visitor, blockScope); + } + } + visitor.endVisit(this, blockScope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java,v retrieving revision 1.41 diff -u -r1.41 ClassLiteralAccess.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 28 Mar 2006 20:29:57 -0000 1.41 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java 13 Oct 2006 18:13:46 -0000 @@ -114,4 +114,14 @@ } visitor.endVisit(this, blockScope); } + + public void traverse( + ASTVisitor visitor, + ClassScope scope) { + + if (visitor.visit(this, scope)) { + type.traverse(visitor, scope); + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java,v retrieving revision 1.14 diff -u -r1.14 FalseLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java 28 Mar 2006 20:29:57 -0000 1.14 +++ compiler/org/eclipse/jdt/internal/compiler/ast/FalseLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -15,6 +15,7 @@ import org.eclipse.jdt.internal.compiler.codegen.CodeStream; import org.eclipse.jdt.internal.compiler.impl.BooleanConstant; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; +import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; public class FalseLiteral extends MagicLiteral { @@ -67,4 +68,8 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java,v retrieving revision 1.28 diff -u -r1.28 QualifiedSuperReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java 10 May 2006 18:03:43 -0000 1.28 +++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java 13 Oct 2006 18:13:46 -0000 @@ -60,4 +60,13 @@ } visitor.endVisit(this, blockScope); } + public void traverse( + ASTVisitor visitor, + ClassScope blockScope) { + + if (visitor.visit(this, blockScope)) { + qualification.traverse(visitor, blockScope); + } + visitor.endVisit(this, blockScope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java,v retrieving revision 1.51 diff -u -r1.51 Argument.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java 9 Jun 2006 10:17:29 -0000 1.51 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java 13 Oct 2006 18:13:45 -0000 @@ -141,4 +141,14 @@ } visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + + if (visitor.visit(this, scope)) { + if (type != null) + type.traverse(visitor, scope); + if (initialization != null) + initialization.traverse(visitor, scope); + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java,v retrieving revision 1.33 diff -u -r1.33 ThisReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java 10 May 2006 18:03:43 -0000 1.33 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ThisReference.java 13 Oct 2006 18:13:46 -0000 @@ -122,4 +122,9 @@ visitor.visit(this, blockScope); visitor.endVisit(this, blockScope); } + public void traverse(ASTVisitor visitor, ClassScope blockScope) { + + visitor.visit(this, blockScope); + visitor.endVisit(this, blockScope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java,v retrieving revision 1.72 diff -u -r1.72 Assignment.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 28 Mar 2006 20:29:56 -0000 1.72 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Assignment.java 13 Oct 2006 18:13:46 -0000 @@ -243,7 +243,13 @@ } visitor.endVisit(this, scope); } - +public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + lhs.traverse(visitor, scope); + expression.traverse(visitor, scope); + } + visitor.endVisit(this, scope); +} public LocalVariableBinding localVariableBinding() { return lhs.localVariableBinding(); } Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java,v retrieving revision 1.30 diff -u -r1.30 JavadocAllocationExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java 2 Jul 2006 12:37:10 -0000 1.30 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocAllocationExpression.java 13 Oct 2006 18:13:46 -0000 @@ -11,6 +11,7 @@ package org.eclipse.jdt.internal.compiler.ast; import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.impl.Constant; import org.eclipse.jdt.internal.compiler.lookup.*; @@ -156,4 +157,38 @@ public TypeBinding resolveType(ClassScope scope) { return internalResolveType(scope); } + public void traverse(ASTVisitor visitor, BlockScope scope) { + if (visitor.visit(this, scope)) { + if (this.typeArguments != null) { + for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) { + this.typeArguments[i].traverse(visitor, scope); + } + } + if (this.type != null) { // enum constant scenario + this.type.traverse(visitor, scope); + } + if (this.arguments != null) { + for (int i = 0, argumentsLength = this.arguments.length; i < argumentsLength; i++) + this.arguments[i].traverse(visitor, scope); + } + } + visitor.endVisit(this, scope); + } + public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + if (this.typeArguments != null) { + for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) { + this.typeArguments[i].traverse(visitor, scope); + } + } + if (this.type != null) { // enum constant scenario + this.type.traverse(visitor, scope); + } + if (this.arguments != null) { + for (int i = 0, argumentsLength = this.arguments.length; i < argumentsLength; i++) + this.arguments[i].traverse(visitor, scope); + } + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java,v retrieving revision 1.16 diff -u -r1.16 DoubleLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java 28 Mar 2006 20:29:56 -0000 1.16 +++ compiler/org/eclipse/jdt/internal/compiler/ast/DoubleLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -106,8 +106,12 @@ public TypeBinding literalType(BlockScope scope) { return TypeBinding.DOUBLE; } - public void traverse(ASTVisitor visitor, BlockScope blockScope) { - visitor.visit(this, blockScope); - visitor.endVisit(this, blockScope); + public void traverse(ASTVisitor visitor, BlockScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java,v retrieving revision 1.84 diff -u -r1.84 ConditionalExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java 20 Jun 2006 13:24:44 -0000 1.84 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java 13 Oct 2006 18:13:46 -0000 @@ -485,4 +485,13 @@ } visitor.endVisit(this, scope); } + + public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + condition.traverse(visitor, scope); + valueIfTrue.traverse(visitor, scope); + valueIfFalse.traverse(visitor, scope); + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java,v retrieving revision 1.26 diff -u -r1.26 StringLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java 28 Mar 2006 20:29:56 -0000 1.26 +++ compiler/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -14,6 +14,7 @@ import org.eclipse.jdt.internal.compiler.codegen.CodeStream; import org.eclipse.jdt.internal.compiler.impl.StringConstant; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; +import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; public class StringLiteral extends Literal { @@ -119,4 +120,8 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java,v retrieving revision 1.112 diff -u -r1.112 MessageSend.java --- compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 28 Mar 2006 20:29:56 -0000 1.112 +++ compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 13 Oct 2006 18:13:46 -0000 @@ -505,4 +505,20 @@ } visitor.endVisit(this, blockScope); } +public void traverse(ASTVisitor visitor, ClassScope blockScope) { + if (visitor.visit(this, blockScope)) { + receiver.traverse(visitor, blockScope); + if (this.typeArguments != null) { + for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) { + this.typeArguments[i].traverse(visitor, blockScope); + } + } + if (arguments != null) { + int argumentsLength = arguments.length; + for (int i = 0; i < argumentsLength; i++) + arguments[i].traverse(visitor, blockScope); + } + } + visitor.endVisit(this, blockScope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java,v retrieving revision 1.54 diff -u -r1.54 Annotation.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 10 May 2006 14:21:40 -0000 1.54 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Annotation.java 13 Oct 2006 18:13:45 -0000 @@ -399,5 +399,6 @@ } public abstract void traverse(ASTVisitor visitor, BlockScope scope); - public abstract void traverse(ASTVisitor visitor, CompilationUnitScope scope); + public abstract void traverse(ASTVisitor visitor, ClassScope scope); + } Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java,v retrieving revision 1.77 diff -u -r1.77 FieldDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 28 Mar 2006 20:29:57 -0000 1.77 +++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java 13 Oct 2006 18:13:46 -0000 @@ -276,6 +276,9 @@ public void traverse(ASTVisitor visitor, MethodScope scope) { if (visitor.visit(this, scope)) { + if (this.javadoc != null) { + this.javadoc.traverse(visitor, scope); + } if (this.annotations != null) { int annotationsLength = this.annotations.length; for (int i = 0; i < annotationsLength; i++) Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImportReference.java =================================================================== RCS file: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImportReference.java diff -N compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImportReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImportReference.java 10 May 2006 18:03:43 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jdt.internal.compiler.ast; - -import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; - -/** - */ -public class JavadocImportReference extends ImportReference { - - public int tagSourceStart, tagSourceEnd; - - /** - * @param tokens - * @param sourcePositions - * @param tagStart - * @param tagEnd - */ - public JavadocImportReference(char[][] tokens, long[] sourcePositions, int tagStart, int tagEnd) { - super(tokens, sourcePositions, false, ClassFileConstants.AccDefault); - this.tagSourceStart = tagStart; - this.tagSourceEnd = tagEnd; - this.bits |= InsideJavadoc; - } - -} Index: compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java,v retrieving revision 1.21 diff -u -r1.21 IntLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java 29 Mar 2006 19:12:36 -0000 1.21 +++ compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -148,4 +148,8 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java,v retrieving revision 1.82 diff -u -r1.82 ConstructorDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java 29 Aug 2006 11:36:11 -0000 1.82 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java 13 Oct 2006 18:13:46 -0000 @@ -444,6 +444,9 @@ public void traverse(ASTVisitor visitor, ClassScope classScope) { if (visitor.visit(this, classScope)) { + if (this.javadoc != null) { + this.javadoc.traverse(visitor, this.scope); + } if (this.annotations != null) { int annotationsLength = this.annotations.length; for (int i = 0; i < annotationsLength; i++) Index: compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java,v retrieving revision 1.126 diff -u -r1.126 TypeDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 29 Aug 2006 11:36:11 -0000 1.126 +++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java 13 Oct 2006 18:13:46 -0000 @@ -1109,6 +1109,9 @@ return; try { if (visitor.visit(this, unitScope)) { + if (this.javadoc != null) { + this.javadoc.traverse(visitor, this.scope); + } if (this.annotations != null) { int annotationsLength = this.annotations.length; for (int i = 0; i < annotationsLength; i++) @@ -1163,6 +1166,9 @@ return; try { if (visitor.visit(this, blockScope)) { + if (this.javadoc != null) { + this.javadoc.traverse(visitor, scope); + } if (this.annotations != null) { int annotationsLength = this.annotations.length; for (int i = 0; i < annotationsLength; i++) @@ -1218,6 +1224,9 @@ return; try { if (visitor.visit(this, classScope)) { + if (this.javadoc != null) { + this.javadoc.traverse(visitor, scope); + } if (this.annotations != null) { int annotationsLength = this.annotations.length; for (int i = 0; i < annotationsLength; i++) Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java,v retrieving revision 1.38 diff -u -r1.38 ArrayAllocationExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java 27 Jun 2006 22:41:59 -0000 1.38 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java 13 Oct 2006 18:13:45 -0000 @@ -173,4 +173,18 @@ } visitor.endVisit(this, scope); } + + public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + int dimensionsLength = this.dimensions.length; + this.type.traverse(visitor, scope); + for (int i = 0; i < dimensionsLength; i++) { + if (this.dimensions[i] != null) + this.dimensions[i].traverse(visitor, scope); + } + if (this.initializer != null) + this.initializer.traverse(visitor, scope); + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java,v retrieving revision 1.23 diff -u -r1.23 MemberValuePair.java --- compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java 13 Sep 2006 02:25:45 -0000 1.23 +++ compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java 13 Oct 2006 18:13:46 -0000 @@ -15,7 +15,7 @@ import org.eclipse.jdt.internal.compiler.lookup.BaseTypeBinding; import org.eclipse.jdt.internal.compiler.lookup.Binding; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; -import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope; +import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.lookup.ElementValuePair; import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; @@ -214,7 +214,7 @@ } visitor.endVisit(this, scope); } - public void traverse(ASTVisitor visitor, CompilationUnitScope scope) { + public void traverse(ASTVisitor visitor, ClassScope scope) { if (visitor.visit(this, scope)) { if (this.value != null) { this.value.traverse(visitor, scope); Index: compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java,v retrieving revision 1.14 diff -u -r1.14 TrueLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java 28 Mar 2006 20:29:56 -0000 1.14 +++ compiler/org/eclipse/jdt/internal/compiler/ast/TrueLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -15,6 +15,7 @@ import org.eclipse.jdt.internal.compiler.codegen.BranchLabel; import org.eclipse.jdt.internal.compiler.impl.BooleanConstant; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; +import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; public class TrueLiteral extends MagicLiteral { @@ -68,4 +69,8 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java,v retrieving revision 1.36 diff -u -r1.36 QualifiedThisReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java 28 Mar 2006 20:29:56 -0000 1.36 +++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java 13 Oct 2006 18:13:46 -0000 @@ -126,4 +126,14 @@ } visitor.endVisit(this, blockScope); } + + public void traverse( + ASTVisitor visitor, + ClassScope blockScope) { + + if (visitor.visit(this, blockScope)) { + qualification.traverse(visitor, blockScope); + } + visitor.endVisit(this, blockScope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java,v retrieving revision 1.11 diff -u -r1.11 SingleMemberAnnotation.java --- compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java 28 Mar 2006 20:29:56 -0000 1.11 +++ compiler/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java 13 Oct 2006 18:13:46 -0000 @@ -59,7 +59,7 @@ } visitor.endVisit(this, scope); } - public void traverse(ASTVisitor visitor, CompilationUnitScope scope) { + public void traverse(ASTVisitor visitor, ClassScope scope) { if (visitor.visit(this, scope)) { if (this.memberValue != null) { this.memberValue.traverse(visitor, scope); Index: compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java,v retrieving revision 1.103 diff -u -r1.103 FieldReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 28 Sep 2006 13:07:21 -0000 1.103 +++ compiler/org/eclipse/jdt/internal/compiler/ast/FieldReference.java 13 Oct 2006 18:13:46 -0000 @@ -579,4 +579,10 @@ } visitor.endVisit(this, scope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + receiver.traverse(visitor, scope); + } + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java,v retrieving revision 1.33 diff -u -r1.33 TypeReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 29 Sep 2006 10:28:22 -0000 1.33 +++ compiler/org/eclipse/jdt/internal/compiler/ast/TypeReference.java 13 Oct 2006 18:13:46 -0000 @@ -184,6 +184,6 @@ protected void reportDeprecatedType(Scope scope) { scope.problemReporter().deprecatedType(this.resolvedType, this); } -public abstract void traverse(ASTVisitor visitor, ClassScope classScope); -public abstract void traverse(ASTVisitor visitor, BlockScope classScope); +public abstract void traverse(ASTVisitor visitor, BlockScope scope); +public abstract void traverse(ASTVisitor visitor, ClassScope scope); } Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java,v retrieving revision 1.42 diff -u -r1.42 ArrayReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java 28 Mar 2006 20:29:57 -0000 1.42 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java 13 Oct 2006 18:13:45 -0000 @@ -219,4 +219,13 @@ } visitor.endVisit(this, scope); } + + public void traverse(ASTVisitor visitor, ClassScope scope) { + + if (visitor.visit(this, scope)) { + receiver.traverse(visitor, scope); + position.traverse(visitor, scope); + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java,v retrieving revision 1.9 diff -u -r1.9 JavadocSingleNameReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java 30 Jan 2006 19:01:13 -0000 1.9 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocSingleNameReference.java 13 Oct 2006 18:13:46 -0000 @@ -57,4 +57,12 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } + /* (non-Javadoc) + * Redefine to capture javadoc specific signatures + * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#traverse(org.eclipse.jdt.internal.compiler.ASTVisitor, org.eclipse.jdt.internal.compiler.lookup.BlockScope) + */ + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java,v retrieving revision 1.16 diff -u -r1.16 FloatLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java 28 Mar 2006 20:29:56 -0000 1.16 +++ compiler/org/eclipse/jdt/internal/compiler/ast/FloatLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -14,6 +14,7 @@ import org.eclipse.jdt.internal.compiler.codegen.CodeStream; import org.eclipse.jdt.internal.compiler.impl.FloatConstant; import org.eclipse.jdt.internal.compiler.lookup.BlockScope; +import org.eclipse.jdt.internal.compiler.lookup.ClassScope; import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; import org.eclipse.jdt.internal.compiler.util.FloatUtil; @@ -108,8 +109,12 @@ public TypeBinding literalType(BlockScope scope) { return TypeBinding.FLOAT; } - public void traverse(ASTVisitor visitor, BlockScope blockScope) { - visitor.visit(this, blockScope); - visitor.endVisit(this, blockScope); + public void traverse(ASTVisitor visitor, BlockScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java,v retrieving revision 1.62 diff -u -r1.62 CompilationUnitDeclaration.java --- compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 28 Mar 2006 20:29:56 -0000 1.62 +++ compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java 13 Oct 2006 18:13:46 -0000 @@ -22,6 +22,7 @@ import org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope; import org.eclipse.jdt.internal.compiler.lookup.ImportBinding; import org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding; +import org.eclipse.jdt.internal.compiler.lookup.MethodScope; import org.eclipse.jdt.internal.compiler.lookup.TypeConstants; import org.eclipse.jdt.internal.compiler.parser.NLSTag; import org.eclipse.jdt.internal.compiler.problem.AbortCompilationUnit; @@ -472,6 +473,23 @@ return; try { if (visitor.visit(this, this.scope)) { + boolean isPackageInfo = isPackageInfo(); + if (this.types != null && isPackageInfo) { + // resolve synthetic type declaration + final TypeDeclaration syntheticTypeDeclaration = types[0]; + // resolve javadoc package if any + final MethodScope classScope = syntheticTypeDeclaration.staticInitializerScope; + if (this.javadoc != null) { + this.javadoc.traverse(visitor, classScope); + } + final Annotation[] annotations = this.currentPackage.annotations; + if (annotations != null) { + int annotationsLength = annotations.length; + for (int i = 0; i < annotationsLength; i++) { + annotations[i].traverse(visitor, classScope); + } + } + } if (currentPackage != null) { currentPackage.traverse(visitor, this.scope); } Index: compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java,v retrieving revision 1.21 diff -u -r1.21 LongLiteral.java --- compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java 29 Mar 2006 19:12:36 -0000 1.21 +++ compiler/org/eclipse/jdt/internal/compiler/ast/LongLiteral.java 13 Oct 2006 18:13:46 -0000 @@ -160,4 +160,8 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } +public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); +} } Index: compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java,v retrieving revision 1.51 diff -u -r1.51 InstanceOfExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java 26 Apr 2006 09:17:30 -0000 1.51 +++ compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java 13 Oct 2006 18:13:46 -0000 @@ -111,4 +111,12 @@ } visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + + if (visitor.visit(this, scope)) { + expression.traverse(visitor, scope); + type.traverse(visitor, scope); + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java,v retrieving revision 1.77 diff -u -r1.77 QualifiedAllocationExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 10 May 2006 20:47:45 -0000 1.77 +++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java 13 Oct 2006 18:13:46 -0000 @@ -399,4 +399,27 @@ } visitor.endVisit(this, scope); } + + public void traverse(ASTVisitor visitor, ClassScope scope) { + + if (visitor.visit(this, scope)) { + if (enclosingInstance != null) + enclosingInstance.traverse(visitor, scope); + if (this.typeArguments != null) { + for (int i = 0, typeArgumentsLength = this.typeArguments.length; i < typeArgumentsLength; i++) { + this.typeArguments[i].traverse(visitor, scope); + } + } + if (this.type != null) // case of enum constant + this.type.traverse(visitor, scope); + if (arguments != null) { + int argumentsLength = arguments.length; + for (int i = 0; i < argumentsLength; i++) + arguments[i].traverse(visitor, scope); + } + if (anonymousType != null) + anonymousType.traverse(visitor, scope); + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java,v retrieving revision 1.107 diff -u -r1.107 QualifiedNameReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 28 Sep 2006 13:07:21 -0000 1.107 +++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java 13 Oct 2006 18:13:46 -0000 @@ -1086,6 +1086,10 @@ visitor.visit(this, scope); visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); + } public String unboundReferenceErrorName() { return new String(tokens[0]); } Index: compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java,v retrieving revision 1.9 diff -u -r1.9 NormalAnnotation.java --- compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java 28 Mar 2006 20:29:57 -0000 1.9 +++ compiler/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java 13 Oct 2006 18:13:46 -0000 @@ -68,7 +68,7 @@ } visitor.endVisit(this, scope); } - public void traverse(ASTVisitor visitor, CompilationUnitScope scope) { + public void traverse(ASTVisitor visitor, ClassScope scope) { if (visitor.visit(this, scope)) { if (this.memberValuePairs != null) { int memberValuePairsLength = this.memberValuePairs.length; Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java,v retrieving revision 1.8 diff -u -r1.8 JavadocImplicitTypeReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 28 Mar 2006 20:29:56 -0000 1.8 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java 13 Oct 2006 18:13:46 -0000 @@ -94,12 +94,14 @@ return internalResolveType(classScope); } - public void traverse(ASTVisitor visitor, BlockScope classScope) { - // Do nothing + public void traverse(ASTVisitor visitor, BlockScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); } - public void traverse(ASTVisitor visitor, ClassScope classScope) { - // Do nothing + public void traverse(ASTVisitor visitor, ClassScope scope) { + visitor.visit(this, scope); + visitor.endVisit(this, scope); } public StringBuffer printExpression(int indent, StringBuffer output) { Index: compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java,v retrieving revision 1.47 diff -u -r1.47 Javadoc.java --- compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java 4 Jul 2006 10:02:42 -0000 1.47 +++ compiler/org/eclipse/jdt/internal/compiler/ast/Javadoc.java 13 Oct 2006 18:13:46 -0000 @@ -11,6 +11,7 @@ package org.eclipse.jdt.internal.compiler.ast; import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.internal.compiler.ASTVisitor; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.lookup.*; import org.eclipse.jdt.internal.compiler.parser.JavadocTagConstants; @@ -741,4 +742,61 @@ } } } + + public void traverse(ASTVisitor visitor, BlockScope scope) { + if (visitor.visit(this, scope)) { + if (this.paramReferences != null) { + for (int i = 0, length = this.paramReferences.length; i < length; i++) { + this.paramReferences[i].traverse(visitor, scope); + } + } + if (this.paramTypeParameters != null) { + for (int i = 0, length = this.paramTypeParameters.length; i < length; i++) { + this.paramTypeParameters[i].traverse(visitor, scope); + } + } + if (this.returnStatement != null) { + this.returnStatement.traverse(visitor, scope); + } + if (this.exceptionReferences != null) { + for (int i = 0, length = this.exceptionReferences.length; i < length; i++) { + this.exceptionReferences[i].traverse(visitor, scope); + } + } + if (this.seeReferences != null) { + for (int i = 0, length = this.seeReferences.length; i < length; i++) { + this.seeReferences[i].traverse(visitor, scope); + } + } + } + visitor.endVisit(this, scope); + } + public void traverse(ASTVisitor visitor, ClassScope scope) { + if (visitor.visit(this, scope)) { + if (this.paramReferences != null) { + for (int i = 0, length = this.paramReferences.length; i < length; i++) { + this.paramReferences[i].traverse(visitor, scope); + } + } + if (this.paramTypeParameters != null) { + for (int i = 0, length = this.paramTypeParameters.length; i < length; i++) { + this.paramTypeParameters[i].traverse(visitor, scope); + } + } + if (this.returnStatement != null) { + this.returnStatement.traverse(visitor, scope); + } + if (this.exceptionReferences != null) { + for (int i = 0, length = this.exceptionReferences.length; i < length; i++) { + this.exceptionReferences[i].traverse(visitor, scope); + } + } + if (this.seeReferences != null) { + for (int i = 0, length = this.seeReferences.length; i < length; i++) { + this.seeReferences[i].traverse(visitor, scope); + } + } + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java,v retrieving revision 1.30 diff -u -r1.30 ImportReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java 10 May 2006 18:03:43 -0000 1.30 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ImportReference.java 13 Oct 2006 18:13:46 -0000 @@ -71,13 +71,8 @@ } public void traverse(ASTVisitor visitor, CompilationUnitScope scope) { - + // annotations are traversed during the compilation unit traversal using a class scope visitor.visit(this, scope); - if (this.annotations != null) { - int annotationsLength = this.annotations.length; - for (int i = 0; i < annotationsLength; i++) - this.annotations[i].traverse(visitor, scope); - } visitor.endVisit(this, scope); } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java,v retrieving revision 1.46 diff -u -r1.46 UnaryExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java 15 Jun 2006 10:33:04 -0000 1.46 +++ compiler/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java 13 Oct 2006 18:13:46 -0000 @@ -298,12 +298,21 @@ } public void traverse( - ASTVisitor visitor, - BlockScope blockScope) { + ASTVisitor visitor, + BlockScope blockScope) { if (visitor.visit(this, blockScope)) { this.expression.traverse(visitor, blockScope); } visitor.endVisit(this, blockScope); } + public void traverse( + ASTVisitor visitor, + ClassScope blockScope) { + + if (visitor.visit(this, blockScope)) { + this.expression.traverse(visitor, blockScope); + } + visitor.endVisit(this, blockScope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java,v retrieving revision 1.21 diff -u -r1.21 JavadocFieldReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java 10 May 2006 18:03:43 -0000 1.21 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java 13 Oct 2006 18:13:46 -0000 @@ -136,4 +136,13 @@ } visitor.endVisit(this, scope); } + public void traverse(ASTVisitor visitor, ClassScope scope) { + + if (visitor.visit(this, scope)) { + if (this.receiver != null) { + this.receiver.traverse(visitor, scope); + } + } + visitor.endVisit(this, scope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java,v retrieving revision 1.103 diff -u -r1.103 CastExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 4 Oct 2006 18:00:20 -0000 1.103 +++ compiler/org/eclipse/jdt/internal/compiler/ast/CastExpression.java 13 Oct 2006 18:13:46 -0000 @@ -489,4 +489,15 @@ } visitor.endVisit(this, blockScope); } + + public void traverse( + ASTVisitor visitor, + ClassScope blockScope) { + + if (visitor.visit(this, blockScope)) { + type.traverse(visitor, blockScope); + expression.traverse(visitor, blockScope); + } + visitor.endVisit(this, blockScope); + } } Index: compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java,v retrieving revision 1.13 diff -u -r1.13 ASTVisitor.java --- compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java 10 May 2006 18:03:50 -0000 1.13 +++ compiler/org/eclipse/jdt/internal/compiler/ASTVisitor.java 13 Oct 2006 18:13:45 -0000 @@ -18,7 +18,6 @@ * A visitor for iterating through the parse tree. */ public abstract class ASTVisitor { - public void acceptProblem(IProblem problem) { // do nothing by default } @@ -27,6 +26,11 @@ BlockScope scope) { // do nothing by default } + public void endVisit( + AllocationExpression allocationExpression, + ClassScope scope) { + // do nothing by default + } public void endVisit(AND_AND_Expression and_and_Expression, BlockScope scope) { // do nothing by default } @@ -38,14 +42,25 @@ public void endVisit(Argument argument, BlockScope scope) { // do nothing by default } + public void endVisit(Argument argument,ClassScope scope) { + // do nothing by default + } public void endVisit( - ArrayAllocationExpression arrayAllocationExpression, - BlockScope scope) { + ArrayAllocationExpression arrayAllocationExpression, + BlockScope scope) { + // do nothing by default + } + public void endVisit( + ArrayAllocationExpression arrayAllocationExpression, + ClassScope scope) { // do nothing by default } public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) { // do nothing by default } + public void endVisit(ArrayInitializer arrayInitializer, ClassScope scope) { + // do nothing by default + } public void endVisit( ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope) { @@ -59,6 +74,9 @@ public void endVisit(ArrayReference arrayReference, BlockScope scope) { // do nothing by default } + public void endVisit(ArrayReference arrayReference, ClassScope scope) { + // do nothing by default + } public void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope) { // do nothing by default } @@ -71,9 +89,15 @@ public void endVisit(Assignment assignment, BlockScope scope) { // do nothing by default } + public void endVisit(Assignment assignment, ClassScope scope) { + // do nothing by default + } public void endVisit(BinaryExpression binaryExpression, BlockScope scope) { // do nothing by default } + public void endVisit(BinaryExpression binaryExpression, ClassScope scope) { + // do nothing by default + } public void endVisit(Block block, BlockScope scope) { // do nothing by default } @@ -86,12 +110,21 @@ public void endVisit(CastExpression castExpression, BlockScope scope) { // do nothing by default } + public void endVisit(CastExpression castExpression, ClassScope scope) { + // do nothing by default + } public void endVisit(CharLiteral charLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(CharLiteral charLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(ClassLiteralAccess classLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(ClassLiteralAccess classLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(Clinit clinit, ClassScope scope) { // do nothing by default } @@ -104,8 +137,13 @@ // do nothing by default } public void endVisit( - ConditionalExpression conditionalExpression, - BlockScope scope) { + ConditionalExpression conditionalExpression, + BlockScope scope) { + // do nothing by default + } + public void endVisit( + ConditionalExpression conditionalExpression, + ClassScope scope) { // do nothing by default } public void endVisit( @@ -122,6 +160,9 @@ public void endVisit(DoubleLiteral doubleLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(DoubleLiteral doubleLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(EmptyStatement emptyStatement, BlockScope scope) { // do nothing by default } @@ -141,15 +182,24 @@ public void endVisit(FalseLiteral falseLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(FalseLiteral falseLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope) { // do nothing by default } public void endVisit(FieldReference fieldReference, BlockScope scope) { // do nothing by default } + public void endVisit(FieldReference fieldReference, ClassScope scope) { + // do nothing by default + } public void endVisit(FloatLiteral floatLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(FloatLiteral floatLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(ForeachStatement forStatement, BlockScope scope) { // do nothing by default } @@ -166,40 +216,87 @@ // do nothing by default } public void endVisit( - InstanceOfExpression instanceOfExpression, - BlockScope scope) { + InstanceOfExpression instanceOfExpression, + BlockScope scope) { + // do nothing by default + } + public void endVisit( + InstanceOfExpression instanceOfExpression, + ClassScope scope) { // do nothing by default } public void endVisit(IntLiteral intLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(IntLiteral intLiteral, ClassScope scope) { + // do nothing by default + } + public void endVisit(Javadoc javadoc, BlockScope scope) { + // do nothing by default + } + public void endVisit(Javadoc javadoc, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocArgumentExpression expression, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocArgumentExpression expression, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocArrayQualifiedTypeReference typeRef, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocArraySingleTypeReference typeRef, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocArraySingleTypeReference typeRef, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocFieldReference fieldRef, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocFieldReference fieldRef, ClassScope scope) { + // do nothing by default + } + public void endVisit(JavadocImplicitTypeReference implicitTypeReference, BlockScope scope) { + // do nothing by default + } + public void endVisit(JavadocImplicitTypeReference implicitTypeReference, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocMessageSend messageSend, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocMessageSend messageSend, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocQualifiedTypeReference typeRef, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocQualifiedTypeReference typeRef, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocReturnStatement statement, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocReturnStatement statement, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocSingleNameReference argument, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocSingleNameReference argument, ClassScope scope) { + // do nothing by default + } public void endVisit(JavadocSingleTypeReference typeRef, BlockScope scope) { // do nothing by default } + public void endVisit(JavadocSingleTypeReference typeRef, ClassScope scope) { + // do nothing by default + } public void endVisit(LabeledStatement labeledStatement, BlockScope scope) { // do nothing by default } @@ -209,6 +306,9 @@ public void endVisit(LongLiteral longLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(LongLiteral longLiteral, ClassScope scope) { + // do nothing by default + } /** * @param annotation * @param scope @@ -220,9 +320,9 @@ /** * @param annotation * @param scope - * @since 3.1 + * @since 3.3 */ - public void endVisit(MarkerAnnotation annotation, CompilationUnitScope scope) { + public void endVisit(MarkerAnnotation annotation, ClassScope scope) { // do nothing by default } /** @@ -236,12 +336,15 @@ * @param pair * @param scope */ - public void endVisit(MemberValuePair pair, CompilationUnitScope scope) { + public void endVisit(MemberValuePair pair, ClassScope scope) { // do nothing by default } public void endVisit(MessageSend messageSend, BlockScope scope) { // do nothing by default } + public void endVisit(MessageSend messageSend, ClassScope scope) { + // do nothing by default + } public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) { // do nothing by default } @@ -259,14 +362,17 @@ /** * @param annotation * @param scope - * @since 3.1 + * @since 3.3 */ - public void endVisit(NormalAnnotation annotation, CompilationUnitScope scope) { + public void endVisit(NormalAnnotation annotation, ClassScope scope) { // do nothing by default } public void endVisit(NullLiteral nullLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(NullLiteral nullLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(OR_OR_Expression or_or_Expression, BlockScope scope) { // do nothing by default } @@ -289,8 +395,13 @@ // do nothing by default } public void endVisit( - QualifiedAllocationExpression qualifiedAllocationExpression, - BlockScope scope) { + QualifiedAllocationExpression qualifiedAllocationExpression, + BlockScope scope) { + // do nothing by default + } + public void endVisit( + QualifiedAllocationExpression qualifiedAllocationExpression, + ClassScope scope) { // do nothing by default } public void endVisit( @@ -299,23 +410,38 @@ // do nothing by default } public void endVisit( - QualifiedSuperReference qualifiedSuperReference, - BlockScope scope) { + QualifiedNameReference qualifiedNameReference, + ClassScope scope) { // do nothing by default } public void endVisit( - QualifiedThisReference qualifiedThisReference, - BlockScope scope) { + QualifiedSuperReference qualifiedSuperReference, + BlockScope scope) { // do nothing by default } public void endVisit( - QualifiedTypeReference qualifiedTypeReference, - BlockScope scope) { + QualifiedSuperReference qualifiedSuperReference, + ClassScope scope) { // do nothing by default } public void endVisit( - QualifiedTypeReference qualifiedTypeReference, - ClassScope scope) { + QualifiedThisReference qualifiedThisReference, + BlockScope scope) { + // do nothing by default + } + public void endVisit( + QualifiedThisReference qualifiedThisReference, + ClassScope scope) { + // do nothing by default + } + public void endVisit( + QualifiedTypeReference qualifiedTypeReference, + BlockScope scope) { + // do nothing by default + } + public void endVisit( + QualifiedTypeReference qualifiedTypeReference, + ClassScope scope) { // do nothing by default } public void endVisit(ReturnStatement returnStatement, BlockScope scope) { @@ -332,29 +458,37 @@ /** * @param annotation * @param scope - * @since 3.1 + * @since 3.3 */ - public void endVisit(SingleMemberAnnotation annotation, CompilationUnitScope scope) { + public void endVisit(SingleMemberAnnotation annotation, ClassScope scope) { // do nothing by default } public void endVisit( - SingleNameReference singleNameReference, - BlockScope scope) { + SingleNameReference singleNameReference, + BlockScope scope) { // do nothing by default } public void endVisit( - SingleTypeReference singleTypeReference, - BlockScope scope) { + SingleNameReference singleNameReference, + ClassScope scope) { + // do nothing by default + } + public void endVisit( + SingleTypeReference singleTypeReference, + BlockScope scope) { // do nothing by default } public void endVisit( - SingleTypeReference singleTypeReference, - ClassScope scope) { + SingleTypeReference singleTypeReference, + ClassScope scope) { // do nothing by default } public void endVisit(StringLiteral stringLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(StringLiteral stringLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(SuperReference superReference, BlockScope scope) { // do nothing by default } @@ -369,12 +503,18 @@ public void endVisit(ThisReference thisReference, BlockScope scope) { // do nothing by default } + public void endVisit(ThisReference thisReference, ClassScope scope) { + // do nothing by default + } public void endVisit(ThrowStatement throwStatement, BlockScope scope) { // do nothing by default } public void endVisit(TrueLiteral trueLiteral, BlockScope scope) { // do nothing by default } + public void endVisit(TrueLiteral trueLiteral, ClassScope scope) { + // do nothing by default + } public void endVisit(TryStatement tryStatement, BlockScope scope) { // do nothing by default } @@ -392,7 +532,7 @@ TypeDeclaration typeDeclaration, CompilationUnitScope scope) { // do nothing by default - } + } public void endVisit(TypeParameter typeParameter, BlockScope scope) { // do nothing by default } @@ -402,6 +542,9 @@ public void endVisit(UnaryExpression unaryExpression, BlockScope scope) { // do nothing by default } + public void endVisit(UnaryExpression unaryExpression, ClassScope scope) { + // do nothing by default + } public void endVisit(WhileStatement whileStatement, BlockScope scope) { // do nothing by default } @@ -412,8 +555,13 @@ // do nothing by default } public boolean visit( - AllocationExpression allocationExpression, - BlockScope scope) { + AllocationExpression allocationExpression, + BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + AllocationExpression allocationExpression, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) { @@ -427,14 +575,25 @@ public boolean visit(Argument argument, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(Argument argument, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit( ArrayAllocationExpression arrayAllocationExpression, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit( + ArrayAllocationExpression arrayAllocationExpression, + ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(ArrayInitializer arrayInitializer, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit( ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope) { @@ -448,6 +607,9 @@ public boolean visit(ArrayReference arrayReference, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(ArrayReference arrayReference, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -460,9 +622,15 @@ public boolean visit(Assignment assignment, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(Assignment assignment, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(BinaryExpression binaryExpression, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(BinaryExpression binaryExpression, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(Block block, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -475,12 +643,21 @@ public boolean visit(CastExpression castExpression, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(CastExpression castExpression, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(CharLiteral charLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(CharLiteral charLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(ClassLiteralAccess classLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(ClassLiteralAccess classLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(Clinit clinit, ClassScope scope) { return true; // do nothing by default, keep traversing } @@ -493,8 +670,13 @@ return true; // do nothing by default, keep traversing } public boolean visit( - ConditionalExpression conditionalExpression, - BlockScope scope) { + ConditionalExpression conditionalExpression, + BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + ConditionalExpression conditionalExpression, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit( @@ -511,6 +693,9 @@ public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(DoubleLiteral doubleLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(EmptyStatement emptyStatement, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -530,15 +715,24 @@ public boolean visit(FalseLiteral falseLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(FalseLiteral falseLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) { return true; // do nothing by default, keep traversing } public boolean visit(FieldReference fieldReference, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(FieldReference fieldReference, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(FloatLiteral floatLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(FloatLiteral floatLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(ForeachStatement forStatement, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -555,40 +749,87 @@ return true; // do nothing by default, keep traversing } public boolean visit( - InstanceOfExpression instanceOfExpression, - BlockScope scope) { + InstanceOfExpression instanceOfExpression, + BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + InstanceOfExpression instanceOfExpression, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit(IntLiteral intLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(IntLiteral intLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit(Javadoc javadoc, BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit(Javadoc javadoc, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocArgumentExpression expression, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocArgumentExpression expression, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocArrayQualifiedTypeReference typeRef, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocArraySingleTypeReference typeRef, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocArraySingleTypeReference typeRef, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocFieldReference fieldRef, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocFieldReference fieldRef, ClassScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit(JavadocImplicitTypeReference implicitTypeReference, BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit(JavadocImplicitTypeReference implicitTypeReference, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocMessageSend messageSend, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocMessageSend messageSend, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocQualifiedTypeReference typeRef, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocQualifiedTypeReference typeRef, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocReturnStatement statement, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocReturnStatement statement, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocSingleNameReference argument, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocSingleNameReference argument, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(JavadocSingleTypeReference typeRef, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(LabeledStatement labeledStatement, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -598,6 +839,9 @@ public boolean visit(LongLiteral longLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(LongLiteral longLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } /** * @param annotation * @param scope @@ -609,9 +853,9 @@ /** * @param annotation * @param scope - * @since 3.1 + * @since 3.3 */ - public boolean visit(MarkerAnnotation annotation, CompilationUnitScope scope) { + public boolean visit(MarkerAnnotation annotation, ClassScope scope) { return true; } /** @@ -625,14 +869,17 @@ /** * @param pair * @param scope - * @since 3.1 + * @since 3.3 */ - public boolean visit(MemberValuePair pair, CompilationUnitScope scope) { + public boolean visit(MemberValuePair pair, ClassScope scope) { return true; } public boolean visit(MessageSend messageSend, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(MessageSend messageSend, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) { return true; // do nothing by default, keep traversing } @@ -652,14 +899,17 @@ /** * @param annotation * @param scope - * @since 3.1 + * @since 3.3 */ - public boolean visit(NormalAnnotation annotation, CompilationUnitScope scope) { + public boolean visit(NormalAnnotation annotation, ClassScope scope) { return true; } public boolean visit(NullLiteral nullLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(NullLiteral nullLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -682,33 +932,53 @@ return true; // do nothing by default, keep traversing } public boolean visit( - QualifiedAllocationExpression qualifiedAllocationExpression, - BlockScope scope) { + QualifiedAllocationExpression qualifiedAllocationExpression, + BlockScope scope) { return true; // do nothing by default, keep traversing } public boolean visit( - QualifiedNameReference qualifiedNameReference, - BlockScope scope) { + QualifiedAllocationExpression qualifiedAllocationExpression, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit( - QualifiedSuperReference qualifiedSuperReference, - BlockScope scope) { + QualifiedNameReference qualifiedNameReference, + BlockScope scope) { return true; // do nothing by default, keep traversing } public boolean visit( - QualifiedThisReference qualifiedThisReference, - BlockScope scope) { + QualifiedNameReference qualifiedNameReference, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit( - QualifiedTypeReference qualifiedTypeReference, - BlockScope scope) { + QualifiedSuperReference qualifiedSuperReference, + BlockScope scope) { return true; // do nothing by default, keep traversing } public boolean visit( - QualifiedTypeReference qualifiedTypeReference, - ClassScope scope) { + QualifiedSuperReference qualifiedSuperReference, + ClassScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + QualifiedThisReference qualifiedThisReference, + BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + QualifiedThisReference qualifiedThisReference, + ClassScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + QualifiedTypeReference qualifiedTypeReference, + BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + QualifiedTypeReference qualifiedTypeReference, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit(ReturnStatement returnStatement, BlockScope scope) { @@ -725,9 +995,9 @@ /** * @param annotation * @param scope - * @since 3.1 + * @since 3.3 */ - public boolean visit(SingleMemberAnnotation annotation, CompilationUnitScope scope) { + public boolean visit(SingleMemberAnnotation annotation, ClassScope scope) { return true; } public boolean visit( @@ -736,18 +1006,26 @@ return true; // do nothing by default, keep traversing } public boolean visit( - SingleTypeReference singleTypeReference, - BlockScope scope) { + SingleNameReference singleNameReference, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit( - SingleTypeReference singleTypeReference, - ClassScope scope) { + SingleTypeReference singleTypeReference, + BlockScope scope) { + return true; // do nothing by default, keep traversing + } + public boolean visit( + SingleTypeReference singleTypeReference, + ClassScope scope) { return true; // do nothing by default, keep traversing } public boolean visit(StringLiteral stringLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(StringLiteral stringLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(SuperReference superReference, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -762,12 +1040,18 @@ public boolean visit(ThisReference thisReference, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(ThisReference thisReference, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(ThrowStatement throwStatement, BlockScope scope) { return true; // do nothing by default, keep traversing } public boolean visit(TrueLiteral trueLiteral, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(TrueLiteral trueLiteral, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(TryStatement tryStatement, BlockScope scope) { return true; // do nothing by default, keep traversing } @@ -795,6 +1079,9 @@ public boolean visit(UnaryExpression unaryExpression, BlockScope scope) { return true; // do nothing by default, keep traversing } + public boolean visit(UnaryExpression unaryExpression, ClassScope scope) { + return true; // do nothing by default, keep traversing + } public boolean visit(WhileStatement whileStatement, BlockScope scope) { return true; // do nothing by default, keep traversing } Index: formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java,v retrieving revision 1.187 diff -u -r1.187 CodeFormatterVisitor.java --- formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 3 Oct 2006 22:40:03 -0000 1.187 +++ formatter/org/eclipse/jdt/internal/formatter/CodeFormatterVisitor.java 13 Oct 2006 18:13:47 -0000 @@ -3964,7 +3964,7 @@ this.scribe.printQualifiedReference(annotation.sourceEnd); return false; } - public boolean visit(MarkerAnnotation annotation, CompilationUnitScope scope) { + public boolean visit(MarkerAnnotation annotation, ClassScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameAT); if (this.preferences.insert_space_after_at_in_annotation) { this.scribe.space(); @@ -3990,16 +3990,6 @@ pair.value.traverse(this, scope); return false; } - public boolean visit(MemberValuePair pair, CompilationUnitScope scope) { - this.scribe.printNextToken(TerminalTokens.TokenNameIdentifier); - this.scribe.printNextToken(TerminalTokens.TokenNameEQUAL, this.preferences.insert_space_before_assignment_operator); - if (this.preferences.insert_space_after_assignment_operator) { - this.scribe.space(); - } - pair.value.traverse(this, scope); - return false; - } - /** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.MessageSend, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ @@ -4218,7 +4208,7 @@ this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation); return false; } - public boolean visit(NormalAnnotation annotation, CompilationUnitScope scope) { + public boolean visit(NormalAnnotation annotation, ClassScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameAT); if (this.preferences.insert_space_after_at_in_annotation) { this.scribe.space(); @@ -4243,7 +4233,6 @@ this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation); return false; } - /** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.NullLiteral, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */ @@ -4740,8 +4729,7 @@ this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation); return false; } - public boolean visit(SingleMemberAnnotation annotation, - CompilationUnitScope scope) { + public boolean visit(SingleMemberAnnotation annotation, ClassScope scope) { this.scribe.printNextToken(TerminalTokens.TokenNameAT); if (this.preferences.insert_space_after_at_in_annotation) { this.scribe.space(); @@ -4755,7 +4743,6 @@ this.scribe.printNextToken(TerminalTokens.TokenNameRPAREN, this.preferences.insert_space_before_closing_paren_in_annotation); return false; } - /** * @see org.eclipse.jdt.internal.compiler.ASTVisitor#visit(org.eclipse.jdt.internal.compiler.ast.SingleNameReference, org.eclipse.jdt.internal.compiler.lookup.BlockScope) */