@@ -71,7 +71,6 @@ import org.aspectj.weaver.ClassAnnotationValue; | |||
import org.aspectj.weaver.EnumAnnotationValue; | |||
import org.aspectj.weaver.ReferenceType; | |||
import org.aspectj.weaver.ResolvedMember; | |||
import org.aspectj.weaver.ResolvedMemberImpl; | |||
import org.aspectj.weaver.ResolvedPointcutDefinition; | |||
import org.aspectj.weaver.ResolvedType; | |||
import org.aspectj.weaver.StandardAnnotation; | |||
@@ -135,11 +134,13 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
resolvedTypeX.setEndPos(declaration.sourceEnd); | |||
} | |||
@Override | |||
public boolean isAspect() { | |||
final boolean isCodeStyle = declaration instanceof AspectDeclaration; | |||
return isCodeStyle ? isCodeStyle : isAnnotationStyleAspect(); | |||
} | |||
@Override | |||
public boolean isAnonymous() { | |||
if (declaration.binding != null) { | |||
return declaration.binding.isAnonymousType(); | |||
@@ -147,6 +148,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return ((declaration.modifiers & (ASTNode.IsAnonymousType | ASTNode.IsLocalType)) != 0); | |||
} | |||
@Override | |||
public boolean isNested() { | |||
if (declaration.binding != null) { | |||
return (declaration.binding.isMemberType()); | |||
@@ -154,6 +156,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return ((declaration.modifiers & ASTNode.IsMemberType) != 0); | |||
} | |||
@Override | |||
public ResolvedType getOuterClass() { | |||
if (declaration.binding != null) { | |||
ReferenceBinding enclosingType = declaration.binding.enclosingType(); | |||
@@ -167,6 +170,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return eclipseWorld().fromEclipse(declaration.enclosingType.binding); | |||
} | |||
@Override | |||
public boolean isAnnotationStyleAspect() { | |||
if (declaration.annotations == null) { | |||
return false; | |||
@@ -234,10 +238,12 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return false; | |||
} | |||
@Override | |||
public WeaverStateInfo getWeaverState() { | |||
return null; | |||
} | |||
@Override | |||
public ResolvedType getSuperclass() { | |||
if (binding.isInterface()) { | |||
return getResolvedTypeX().getWorld().getCoreType(UnresolvedType.OBJECT); | |||
@@ -246,6 +252,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return eclipseWorld().fromEclipse(binding.superclass()); | |||
} | |||
@Override | |||
public ResolvedType[] getDeclaredInterfaces() { | |||
return eclipseWorld().fromEclipse(binding.superInterfaces()); | |||
} | |||
@@ -420,6 +427,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
* This method may not return all fields, for example it may not include the ajc$initFailureCause or ajc$perSingletonInstance | |||
* fields - see bug 129613 | |||
*/ | |||
@Override | |||
public ResolvedMember[] getDeclaredFields() { | |||
if (declaredFields == null) { | |||
fillDeclaredMembers(); | |||
@@ -431,6 +439,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
* This method may not return all methods, for example it may not include clinit, aspectOf, hasAspect or ajc$postClinit methods | |||
* - see bug 129613 | |||
*/ | |||
@Override | |||
public ResolvedMember[] getDeclaredMethods() { | |||
if (declaredMethods == null) { | |||
fillDeclaredMembers(); | |||
@@ -438,6 +447,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return declaredMethods; | |||
} | |||
@Override | |||
public ResolvedMember[] getDeclaredPointcuts() { | |||
if (declaredPointcuts == null) { | |||
fillDeclaredMembers(); | |||
@@ -445,11 +455,13 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return declaredPointcuts; | |||
} | |||
@Override | |||
public int getModifiers() { | |||
// only return the real Java modifiers, not the extra eclipse ones | |||
return binding.modifiers & ExtraCompilerModifiers.AccJustFlag; | |||
} | |||
@Override | |||
public String toString() { | |||
return "EclipseSourceType(" + new String(binding.sourceName()) + ")"; | |||
} | |||
@@ -516,6 +528,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
// dec.sourceEnd); | |||
// } | |||
@Override | |||
public boolean isInterface() { | |||
return binding.isInterface(); | |||
} | |||
@@ -525,14 +538,17 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
public final static short ACC_ANNOTATION = 0x2000; | |||
public final static short ACC_ENUM = 0x4000; | |||
@Override | |||
public boolean isEnum() { | |||
return (binding.getAccessFlags() & ACC_ENUM) != 0; | |||
} | |||
@Override | |||
public boolean isAnnotation() { | |||
return (binding.getAccessFlags() & ACC_ANNOTATION) != 0; | |||
} | |||
@Override | |||
public boolean isAnnotationWithRuntimeRetention() { | |||
if (!isAnnotation()) { | |||
return false; | |||
@@ -541,6 +557,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
} | |||
} | |||
@Override | |||
public String getRetentionPolicy() { | |||
if (isAnnotation()) { | |||
if ((binding.getAnnotationTagBits() & TagBits.AnnotationRetentionMASK) == TagBits.AnnotationRuntimeRetention) { | |||
@@ -556,6 +573,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return null; | |||
} | |||
@Override | |||
public boolean canAnnotationTargetType() { | |||
if (isAnnotation()) { | |||
return ((binding.getAnnotationTagBits() & TagBits.AnnotationForType) != 0); | |||
@@ -563,6 +581,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return false; | |||
} | |||
@Override | |||
public AnnotationTargetKind[] getAnnotationTargetKinds() { | |||
if (discoveredAnnotationTargetKinds) { | |||
return annotationTargetKinds; | |||
@@ -655,6 +674,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
} | |||
} | |||
@Override | |||
public boolean hasAnnotation(UnresolvedType ofType) { | |||
ensureAnnotationTypesResolved(); | |||
for (int a = 0, max = annotationTypes.length; a < max; a++) { | |||
@@ -680,6 +700,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
* annotations, this code only needs to deal with converting system annotations that the weaver needs to process | |||
* (RetentionPolicy, Target). | |||
*/ | |||
@Override | |||
public AnnotationAJ[] getAnnotations() { | |||
int declarationAnnoCount = (declaration.annotations == null ? 0 : declaration.annotations.length); | |||
if (annotations != null && annotations.length == declarationAnnoCount) { | |||
@@ -701,6 +722,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return annotations; | |||
} | |||
@Override | |||
public boolean hasAnnotations() { | |||
return (declaration.annotations != null && declaration.annotations.length != 0); | |||
} | |||
@@ -1002,11 +1024,13 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
} | |||
} | |||
@Override | |||
public ResolvedType[] getAnnotationTypes() { | |||
ensureAnnotationTypesResolved(); | |||
return annotationTypes; | |||
} | |||
@Override | |||
public PerClause getPerClause() { | |||
// should probably be: ((AspectDeclaration)declaration).perClause; | |||
// but we don't need this level of detail, and working with real per | |||
@@ -1147,30 +1171,37 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { | |||
return kind; | |||
} | |||
public Collection getDeclares() { | |||
@Override | |||
public Collection<Declare> getDeclares() { | |||
return declares; | |||
} | |||
public Collection getPrivilegedAccesses() { | |||
return Collections.EMPTY_LIST; | |||
@Override | |||
public Collection<ResolvedMember> getPrivilegedAccesses() { | |||
return Collections.emptyList(); | |||
} | |||
@Override | |||
public Collection getTypeMungers() { | |||
return typeMungers; | |||
} | |||
@Override | |||
public boolean doesNotExposeShadowMungers() { | |||
return true; | |||
} | |||
@Override | |||
public String getDeclaredGenericSignature() { | |||
return CharOperation.charToString(binding.genericSignature()); | |||
} | |||
@Override | |||
public boolean isGeneric() { | |||
return binding.isGenericType(); | |||
} | |||
@Override | |||
public TypeVariable[] getTypeVariables() { | |||
if (declaration.typeParameters == null) { | |||
return new TypeVariable[0]; |
@@ -14,7 +14,8 @@ package org.aspectj.ajdt.internal.compiler.batch; | |||
import java.io.File; | |||
import java.io.IOException; | |||
import java.util.*; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import org.aspectj.ajdt.ajc.AjdtAjcTests; | |||
import org.aspectj.tools.ajc.AjcTests; | |||
@@ -275,7 +276,7 @@ public class BcweaverJarMaker { | |||
/* | |||
* ITD | |||
*/ | |||
args = new ArrayList(); | |||
args = new ArrayList<>(); | |||
args.add("-Xlint:ignore"); | |||
args.add("-classpath"); | |||
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" + |
@@ -85,7 +85,7 @@ public class BinaryFormsTestCase extends CommandTestCase { | |||
TestUtil.runMain(getSandboxName() + File.pathSeparator + library, "client.Client1"); | |||
args = new ArrayList(); | |||
args = new ArrayList<>(); | |||
args.add("-aspectpath"); | |||
args.add(library); | |||
@@ -13,17 +13,6 @@ | |||
package org.aspectj.ajdt.internal.compiler.batch; | |||
import org.aspectj.bridge.ICommand; | |||
import org.aspectj.bridge.IMessage; | |||
import org.aspectj.bridge.IMessageHandler; | |||
import org.aspectj.bridge.IMessageHolder; | |||
import org.aspectj.bridge.ISourceLocation; | |||
import org.aspectj.bridge.Message; | |||
import org.aspectj.bridge.MessageHandler; | |||
import org.aspectj.bridge.ReflectionFactory; | |||
import org.aspectj.util.FileUtil; | |||
import org.aspectj.util.LangUtil; | |||
import java.io.File; | |||
import java.io.FileFilter; | |||
import java.io.FileInputStream; | |||
@@ -32,11 +21,20 @@ import java.util.ArrayList; | |||
import java.util.Arrays; | |||
import java.util.BitSet; | |||
import java.util.Collections; | |||
//import java.util.Enumeration; | |||
import java.util.Iterator; | |||
import java.util.List; | |||
import java.util.Properties; | |||
import org.aspectj.bridge.ICommand; | |||
import org.aspectj.bridge.IMessage; | |||
import org.aspectj.bridge.IMessageHandler; | |||
import org.aspectj.bridge.IMessageHolder; | |||
import org.aspectj.bridge.ISourceLocation; | |||
import org.aspectj.bridge.Message; | |||
import org.aspectj.bridge.MessageHandler; | |||
import org.aspectj.bridge.ReflectionFactory; | |||
import org.aspectj.util.FileUtil; | |||
import org.aspectj.util.LangUtil; | |||
/** | |||
* Mostly stateless incremental test case. | |||
* Subclass to use from junit. | |||
@@ -86,8 +84,9 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? | |||
if (null == targetClasses) { | |||
return false; | |||
} | |||
final ArrayList files = new ArrayList(); | |||
final ArrayList<File> files = new ArrayList<>(); | |||
final FileFilter collector = new FileFilter() { | |||
@Override | |||
public boolean accept(File file) { | |||
return files.add(file); | |||
} | |||
@@ -122,13 +121,13 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? | |||
List safeFiles = Collections.unmodifiableList(files); | |||
log("Compiling ", safeFiles, handler); | |||
if (1 == i) { | |||
ArrayList argList = new ArrayList(); | |||
ArrayList<String> argList = new ArrayList<>(); | |||
argList.addAll(getBaseArgs(targetSrc, targetClasses)); | |||
File[] fra = (File[]) safeFiles.toArray(new File[0]); | |||
// sigh | |||
argList.addAll( | |||
Arrays.asList(FileUtil.getAbsolutePaths(fra))); | |||
String[] args = (String[]) argList.toArray(new String[0]); | |||
String[] args = argList.toArray(new String[0]); | |||
commandLine.append(""+argList); | |||
result = compiler.runCommand(args, compilerMessages); | |||
} else { | |||
@@ -227,7 +226,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? | |||
public File outputDir; | |||
/** @param srcDir ignored for now */ | |||
protected List getBaseArgs(File srcDir, File classesDir) { | |||
protected List<String> getBaseArgs(File srcDir, File classesDir) { | |||
outputDir = classesDir; | |||
String[] input = | |||
new String[] { | |||
@@ -237,7 +236,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? | |||
"-d", | |||
classesDir.getAbsolutePath()}; | |||
return Collections.unmodifiableList( | |||
new ArrayList(Arrays.asList(input))); | |||
new ArrayList<String>(Arrays.asList(input))); | |||
} | |||
protected File makeDir( | |||
@@ -258,8 +257,8 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? | |||
// -------------------------------------- test case verification | |||
List normalizeFilenames(String[] ra) { // XXX util | |||
ArrayList result = new ArrayList(); | |||
List<String> normalizeFilenames(String[] ra) { // XXX util | |||
ArrayList<String> result = new ArrayList<>(); | |||
if (null != ra) { | |||
for (int i = 0; i < ra.length; i++) { | |||
result.add(normalizeFilename(ra[i])); | |||
@@ -272,10 +271,11 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? | |||
} | |||
/** @param list the List of File */ | |||
List normalizeFilenames(List list) { // XXX util | |||
ArrayList result = new ArrayList(); | |||
for (Iterator iter = list.iterator(); iter.hasNext();) { | |||
result.add(normalizeFilename(((File) iter.next()).getPath())); | |||
List<String> normalizeFilenames(List<File> list) { // XXX util | |||
ArrayList<String> result = new ArrayList<>(); | |||
for (File file: list) { | |||
// for (Iterator<?> iter = list.iterator(); iter.hasNext();) { | |||
result.add(normalizeFilename(file.getPath())); | |||
} | |||
Collections.sort(result); | |||
return result; | |||
@@ -459,6 +459,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? | |||
} | |||
return null; | |||
} | |||
@Override | |||
public String toString() { | |||
return "Definition " | |||
+ " expectFail=" |
@@ -13,8 +13,6 @@ package org.aspectj.tools.ajc; | |||
import java.util.HashMap; | |||
import java.util.Map; | |||
import junit.framework.TestCase; | |||
import org.aspectj.org.eclipse.jdt.core.JavaCore; | |||
import org.aspectj.org.eclipse.jdt.core.dom.AST; | |||
import org.aspectj.org.eclipse.jdt.core.dom.ASTParser; | |||
@@ -77,6 +75,8 @@ import org.aspectj.org.eclipse.jdt.core.dom.VariableDeclarationStatement; | |||
import org.aspectj.org.eclipse.jdt.core.dom.WildTypePattern; | |||
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions; | |||
import junit.framework.TestCase; | |||
public class ASTVisitorTest extends TestCase { | |||
public void testEnum_pr211201() { | |||
@@ -406,7 +406,7 @@ public class ASTVisitorTest extends TestCase { | |||
private void check(String source, String expectedOutput){ | |||
ASTParser parser = ASTParser.newParser(AST.JLS3);//JLS2); // ajh02: need to use 2 for returnType - in 3 it has "returnType2" | |||
Map options = new HashMap(); | |||
Map<String, String> options = new HashMap<>(); | |||
options.put(CompilerOptions.OPTION_Source, "1.5"); | |||
parser.setCompilerOptions(options);//JavaCore.getOptions()); | |||
parser.setSource(source.toCharArray()); | |||
@@ -436,6 +436,7 @@ public class ASTVisitorTest extends TestCase { | |||
} | |||
/** @deprecated using deprecated code */ | |||
@Deprecated | |||
private static final int AST_INTERNAL_JLS2 = AST.JLS2; | |||
@@ -444,11 +445,14 @@ public class ASTVisitorTest extends TestCase { | |||
* that come from testing Javadoc.getComment()) | |||
* | |||
*/ | |||
@Deprecated | |||
@Override | |||
protected void setUp() throws Exception { | |||
super.setUp(); | |||
} | |||
@Override | |||
protected void tearDown() throws Exception { | |||
super.tearDown(); | |||
} | |||
@@ -472,6 +476,7 @@ class TestVisitor extends AjASTVisitor { | |||
this(false); | |||
} | |||
@Override | |||
public String toString(){ | |||
return b.toString(); | |||
} | |||
@@ -489,6 +494,7 @@ class TestVisitor extends AjASTVisitor { | |||
visitTheKids = visitChildren; | |||
} | |||
@Override | |||
public boolean visit(TypeDeclaration node) { | |||
if (((AjTypeDeclaration)node).isAspect()) { | |||
if (((AspectDeclaration) node).isPrivileged()){ | |||
@@ -506,6 +512,7 @@ class TestVisitor extends AjASTVisitor { | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(TypeDeclaration node) { | |||
if (((AjTypeDeclaration)node).isAspect()) | |||
if (((AspectDeclaration) node).isPrivileged() | |||
@@ -515,66 +522,83 @@ class TestVisitor extends AjASTVisitor { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(EnumDeclaration node) { | |||
b.append("(enum"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(EnumDeclaration node) { | |||
b.append(")"); | |||
} | |||
@Override | |||
public boolean visit(PointcutDeclaration node) { | |||
b.append("(pointcut"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(PointcutDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(ReferencePointcut node) { | |||
b.append("(referencePointcut"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(ReferencePointcut node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(BeforeAdviceDeclaration node) { | |||
b.append("(beforeAdvice"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(AroundAdviceDeclaration node) { | |||
b.append("(aroundAdvice"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(AfterAdviceDeclaration node) { | |||
b.append("(afterAdvice"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(AfterThrowingAdviceDeclaration node) { | |||
b.append("(afterThrowingAdvice"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(AfterReturningAdviceDeclaration node) { | |||
b.append("(afterReturningAdvice"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(BeforeAdviceDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(AroundAdviceDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(AfterAdviceDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(AfterThrowingAdviceDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(AfterReturningAdviceDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(MethodDeclaration node) { | |||
if (node instanceof InterTypeMethodDeclaration) return visit((InterTypeMethodDeclaration)node); | |||
if (node.isConstructor()){ | |||
@@ -584,16 +608,20 @@ class TestVisitor extends AjASTVisitor { | |||
} | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(MethodDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(InterTypeFieldDeclaration node) { | |||
b.append("(fieldITD"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(InterTypeFieldDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(InterTypeMethodDeclaration node) { | |||
if (node.isConstructor()){ | |||
b.append("(constructorITD"); | |||
@@ -602,13 +630,16 @@ class TestVisitor extends AjASTVisitor { | |||
} | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(InterTypeMethodDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(MethodInvocation node) { | |||
b.append("(methodInvocation"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(MethodInvocation node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@@ -619,94 +650,120 @@ class TestVisitor extends AjASTVisitor { | |||
public void endVisit(BodyDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(FieldDeclaration node) { | |||
b.append("(field"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(FieldDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(FieldAccess node) { | |||
b.append("(fieldAccess"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(FieldAccess node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(Assignment node) { | |||
b.append("(assignment"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(Assignment node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(Block node) { | |||
b.append("(block"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(Block node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(CompilationUnit node) { | |||
b.append("(compilationUnit"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(CompilationUnit node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(ExpressionStatement node) { | |||
b.append("(expressionStatement"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(ExpressionStatement node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(InfixExpression node) { | |||
b.append("(infixExpression"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(InfixExpression node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(Initializer node) { | |||
b.append("(initializer"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(Initializer node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(NumberLiteral node) { | |||
b.append("(numberLiteral"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(NumberLiteral node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(PrimitiveType node) { | |||
b.append("(primitiveType"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(PrimitiveType node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(QualifiedName node) { | |||
b.append("(qualifiedName"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(QualifiedName node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(SimpleName node) { | |||
b.append("(simpleName"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(SimpleName node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(StringLiteral node) { | |||
b.append("(stringLiteral"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(StringLiteral node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@@ -714,93 +771,116 @@ class TestVisitor extends AjASTVisitor { | |||
b.append("(variableDeclaration"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(BlockComment bc) { | |||
b.append("(blockcomment"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(BlockComment bc) { | |||
b.append(")"); | |||
} | |||
public void endVisit(VariableDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(VariableDeclarationStatement node) { | |||
b.append("(variableDeclarationStatement"); //$NON-NLS-1$ | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(VariableDeclarationStatement node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(DeclareAtTypeDeclaration node) { | |||
b.append("(declareAtType"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclareAtMethodDeclaration node) { | |||
b.append("(declareAtMethod"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclareAtConstructorDeclaration node) { | |||
b.append("(declareAtConstructor"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclareAtFieldDeclaration node) { | |||
b.append("(declareAtField"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclareErrorDeclaration node) { | |||
b.append("(declareError"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclareParentsDeclaration node) { | |||
b.append("(declareParents"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclarePrecedenceDeclaration node) { | |||
b.append("(declarePrecedence"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclareSoftDeclaration node) { | |||
b.append("(declareSoft"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(DeclareWarningDeclaration node) { | |||
b.append("(declareWarning"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(DeclareErrorDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclareParentsDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclarePrecedenceDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclareAtFieldDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclareAtMethodDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclareAtTypeDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclareAtConstructorDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclareSoftDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(DeclareWarningDeclaration node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(AbstractBooleanTypePattern node) { | |||
b.append("("); | |||
node.getLeft().accept(this); | |||
@@ -817,27 +897,32 @@ class TestVisitor extends AjASTVisitor { | |||
} | |||
@Override | |||
public boolean visit(AnyTypePattern node) { | |||
b.append("(anyTypePattern"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(AnyTypePattern node) { | |||
b.append(")"); | |||
} | |||
@Override | |||
public boolean visit(AnyWithAnnotationTypePattern node) { | |||
b.append("(anyWithAnnotationTypePattern"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(AnyWithAnnotationTypePattern node) { | |||
b.append(")"); | |||
} | |||
@Override | |||
public boolean visit(IdentifierTypePattern node) { | |||
if (node instanceof WildTypePattern) { | |||
b.append("(wildTypePattern"); | |||
@@ -850,28 +935,33 @@ class TestVisitor extends AjASTVisitor { | |||
} | |||
@Override | |||
public void endVisit(IdentifierTypePattern node) { | |||
b.append(")"); | |||
} | |||
@Override | |||
public boolean visit(NotTypePattern node) { | |||
b.append("(notTypePattern"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(NotTypePattern node) { | |||
b.append(")"); | |||
} | |||
@Override | |||
public boolean visit(TypeCategoryTypePattern node) { | |||
b.append("(typeCategoryTypePattern"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(TypeCategoryTypePattern node) { | |||
b.append(")"); | |||
} | |||
@@ -879,31 +969,39 @@ class TestVisitor extends AjASTVisitor { | |||
// End of TypePattern additions for Bugzilla 329268 | |||
@Override | |||
public boolean visit(SignaturePattern node) { | |||
b.append("(signaturePattern"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(SignaturePattern node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public boolean visit(PerObject node) { | |||
b.append("(perObject"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(PerCflow node) { | |||
b.append("(perCflow"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public boolean visit(PerTypeWithin node) { | |||
b.append("(perTypeWithin"); | |||
return isVisitingChildren(); | |||
} | |||
@Override | |||
public void endVisit(PerObject node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(PerCflow node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} | |||
@Override | |||
public void endVisit(PerTypeWithin node) { | |||
b.append(")"); //$NON-NLS-1$ | |||
} |