public void visitLocalVariableTypeTable(LocalVariableTypeTable obj);
public void visitMethodParameters(MethodParameters methodParameters);
+
+ public void visitModule(Module m);
}
/**
* @return deep copy of this attribute //
*/
- // @Override
- // public Attribute copy(ConstantPool constant_pool) {
- // return (SourceFile) clone();
- // }
+// @Override
+// public Attribute copy(ConstantPool constant_pool) {
+// return (Module) clone();
+// }
+
@Override
public void accept(ClassVisitor v) {
- v.visitSourceFile(this);
+ v.visitModule(this);
}
public Require[] getRequires() {
import org.aspectj.apache.bcel.classfile.LocalVariableTypeTable;
import org.aspectj.apache.bcel.classfile.Method;
import org.aspectj.apache.bcel.classfile.MethodParameters;
+import org.aspectj.apache.bcel.classfile.Module;
import org.aspectj.apache.bcel.classfile.Signature;
import org.aspectj.apache.bcel.classfile.SourceFile;
import org.aspectj.apache.bcel.classfile.StackMap;
import org.aspectj.apache.bcel.classfile.annotation.RuntimeVisTypeAnnos;
/**
- * Traverses a JavaClass with another Visitor object 'piggy-backed'
- * that is applied to all components of a JavaClass object. I.e. this
- * class supplies the traversal strategy, other classes can make use
- * of it.
+ * Traverses a JavaClass with another Visitor object 'piggy-backed' that is
+ * applied to all components of a JavaClass object. I.e. this class supplies the
+ * traversal strategy, other classes can make use of it.
*
* @version $Id: DescendingVisitor.java,v 1.4 2009/09/15 19:40:22 aclement Exp $
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
+ * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
*/
public class DescendingVisitor implements ClassVisitor {
- private JavaClass clazz;
- private ClassVisitor visitor;
- private Stack<Object> stack = new Stack<Object>();
-
- /** @return container of current entitity, i.e., predecessor during traversal
- */
- public Object predecessor() {
- return predecessor(0);
- }
-
- /**
- * @param level nesting level, i.e., 0 returns the direct predecessor
- * @return container of current entitity, i.e., predecessor during traversal
- */
- public Object predecessor(int level) {
- int size = stack.size();
-
- if((size < 2) || (level < 0))
- return null;
- else
- return stack.elementAt(size - (level + 2)); // size - 1 == current
- }
-
- /** @return current object
- */
- public Object current() {
- return stack.peek();
- }
-
- /**
- * @param clazz Class to traverse
- * @param visitor visitor object to apply to all components
- */
- public DescendingVisitor(JavaClass clazz, ClassVisitor visitor) {
- this.clazz = clazz;
- this.visitor = visitor;
- }
-
- /**
- * Start traversal.
- */
- public void visit() { clazz.accept(this); }
-
- public void visitJavaClass(JavaClass clazz) {
- stack.push(clazz);
- clazz.accept(visitor);
-
- Field[] fields = clazz.getFields();
- for(int i=0; i < fields.length; i++)
- fields[i].accept(this);
-
- Method[] methods = clazz.getMethods();
- for(int i=0; i < methods.length; i++)
- methods[i].accept(this);
-
- AttributeUtils.accept(clazz.getAttributes(),visitor);
-// clazz.getAttributes().accept(this);
- clazz.getConstantPool().accept(this);
- stack.pop();
- }
-
- public void visitField(Field field) {
- stack.push(field);
- field.accept(visitor);
- AttributeUtils.accept(field.getAttributes(),visitor);
-// field.getAttributes().accept(this);
- stack.pop();
- }
-
- public void visitConstantValue(ConstantValue cv) {
- stack.push(cv);
- cv.accept(visitor);
- stack.pop();
- }
-
- public void visitMethod(Method method) {
- stack.push(method);
- method.accept(visitor);
- AttributeUtils.accept(method.getAttributes(),visitor);
- stack.pop();
- }
-
- public void visitExceptionTable(ExceptionTable table) {
- stack.push(table);
- table.accept(visitor);
- stack.pop();
- }
-
- public void visitCode(Code code) {
- stack.push(code);
- code.accept(visitor);
-
- CodeException[] table = code.getExceptionTable();
- for(int i=0; i < table.length; i++)
- table[i].accept(this);
-
- Attribute[] attributes = code.getAttributes();
- for(int i=0; i < attributes.length; i++)
- attributes[i].accept(this);
- stack.pop();
- }
-
- public void visitCodeException(CodeException ce) {
- stack.push(ce);
- ce.accept(visitor);
- stack.pop();
- }
-
- public void visitLineNumberTable(LineNumberTable table) {
- stack.push(table);
- table.accept(visitor);
-
- LineNumber[] numbers = table.getLineNumberTable();
- for(int i=0; i < numbers.length; i++)
- numbers[i].accept(this);
- stack.pop();
- }
-
- public void visitLineNumber(LineNumber number) {
- stack.push(number);
- number.accept(visitor);
- stack.pop();
- }
-
- public void visitLocalVariableTable(LocalVariableTable table) {
- stack.push(table);
- table.accept(visitor);
-
- LocalVariable[] vars = table.getLocalVariableTable();
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitStackMap(StackMap table) {
- stack.push(table);
- table.accept(visitor);
-
- StackMapEntry[] vars = table.getStackMap();
-
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitStackMapEntry(StackMapEntry var) {
- stack.push(var);
- var.accept(visitor);
- stack.pop();
- }
-
- public void visitLocalVariable(LocalVariable var) {
- stack.push(var);
- var.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantPool(ConstantPool cp) {
- stack.push(cp);
- cp.accept(visitor);
-
- Constant[] constants = cp.getConstantPool();
- for(int i=1; i < constants.length; i++) {
- if(constants[i] != null)
- constants[i].accept(this);
- }
-
- stack.pop();
- }
-
- public void visitConstantClass(ConstantClass constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantDouble(ConstantDouble constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantFieldref(ConstantFieldref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantFloat(ConstantFloat constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantInteger(ConstantInteger constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantLong(ConstantLong constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantMethodref(ConstantMethodref constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantMethodHandle(ConstantMethodHandle constant) {
- throw new IllegalStateException("nyi");
- }
-
- public void visitConstantMethodType(ConstantMethodType obj) {
- throw new IllegalStateException("nyi");
- }
-
- public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj) {
- throw new IllegalStateException("nyi");
- }
-
- public void visitBootstrapMethods(BootstrapMethods obj) {
- throw new IllegalStateException("nyi");
- }
-
- public void visitConstantNameAndType(ConstantNameAndType constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantString(ConstantString constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitConstantUtf8(ConstantUtf8 constant) {
- stack.push(constant);
- constant.accept(visitor);
- stack.pop();
- }
-
- public void visitInnerClasses(InnerClasses ic) {
- stack.push(ic);
- ic.accept(visitor);
-
- InnerClass[] ics = ic.getInnerClasses();
- for(int i=0; i < ics.length; i++)
- ics[i].accept(this);
- stack.pop();
- }
-
- public void visitInnerClass(InnerClass inner) {
- stack.push(inner);
- inner.accept(visitor);
- stack.pop();
- }
-
- public void visitDeprecated(Deprecated attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSignature(Signature attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- // J5SUPPORT:
- public void visitEnclosingMethod(EnclosingMethod attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitRuntimeVisibleAnnotations(RuntimeVisAnnos attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitRuntimeInvisibleAnnotations(RuntimeInvisAnnos attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitRuntimeVisibleParameterAnnotations(RuntimeVisParamAnnos attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisParamAnnos attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitRuntimeVisibleTypeAnnotations(RuntimeVisTypeAnnos attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitMethodParameters(MethodParameters attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisTypeAnnos attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitAnnotationDefault(AnnotationDefault attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitLocalVariableTypeTable(LocalVariableTypeTable table) {
- stack.push(table);
- table.accept(visitor);
-
- LocalVariable[] vars = table.getLocalVariableTypeTable();
- for(int i=0; i < vars.length; i++)
- vars[i].accept(this);
- stack.pop();
- }
-
- public void visitSourceFile(SourceFile attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitSynthetic(Synthetic attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
-
- public void visitUnknown(Unknown attribute) {
- stack.push(attribute);
- attribute.accept(visitor);
- stack.pop();
- }
+ private JavaClass clazz;
+ private ClassVisitor visitor;
+ private Stack<Object> stack = new Stack<Object>();
+
+ /**
+ * @return container of current entitity, i.e., predecessor during traversal
+ */
+ public Object predecessor() {
+ return predecessor(0);
+ }
+
+ /**
+ * @param level
+ * nesting level, i.e., 0 returns the direct predecessor
+ * @return container of current entitity, i.e., predecessor during traversal
+ */
+ public Object predecessor(int level) {
+ int size = stack.size();
+
+ if ((size < 2) || (level < 0))
+ return null;
+ else
+ return stack.elementAt(size - (level + 2)); // size - 1 == current
+ }
+
+ /**
+ * @return current object
+ */
+ public Object current() {
+ return stack.peek();
+ }
+
+ /**
+ * @param clazz
+ * Class to traverse
+ * @param visitor
+ * visitor object to apply to all components
+ */
+ public DescendingVisitor(JavaClass clazz, ClassVisitor visitor) {
+ this.clazz = clazz;
+ this.visitor = visitor;
+ }
+
+ /**
+ * Start traversal.
+ */
+ public void visit() {
+ clazz.accept(this);
+ }
+
+ public void visitJavaClass(JavaClass clazz) {
+ stack.push(clazz);
+ clazz.accept(visitor);
+
+ Field[] fields = clazz.getFields();
+ for (int i = 0; i < fields.length; i++)
+ fields[i].accept(this);
+
+ Method[] methods = clazz.getMethods();
+ for (int i = 0; i < methods.length; i++)
+ methods[i].accept(this);
+
+ AttributeUtils.accept(clazz.getAttributes(), visitor);
+ // clazz.getAttributes().accept(this);
+ clazz.getConstantPool().accept(this);
+ stack.pop();
+ }
+
+ public void visitField(Field field) {
+ stack.push(field);
+ field.accept(visitor);
+ AttributeUtils.accept(field.getAttributes(), visitor);
+ // field.getAttributes().accept(this);
+ stack.pop();
+ }
+
+ public void visitConstantValue(ConstantValue cv) {
+ stack.push(cv);
+ cv.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitMethod(Method method) {
+ stack.push(method);
+ method.accept(visitor);
+ AttributeUtils.accept(method.getAttributes(), visitor);
+ stack.pop();
+ }
+
+ public void visitExceptionTable(ExceptionTable table) {
+ stack.push(table);
+ table.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitCode(Code code) {
+ stack.push(code);
+ code.accept(visitor);
+
+ CodeException[] table = code.getExceptionTable();
+ for (int i = 0; i < table.length; i++)
+ table[i].accept(this);
+
+ Attribute[] attributes = code.getAttributes();
+ for (int i = 0; i < attributes.length; i++)
+ attributes[i].accept(this);
+ stack.pop();
+ }
+
+ public void visitCodeException(CodeException ce) {
+ stack.push(ce);
+ ce.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitLineNumberTable(LineNumberTable table) {
+ stack.push(table);
+ table.accept(visitor);
+
+ LineNumber[] numbers = table.getLineNumberTable();
+ for (int i = 0; i < numbers.length; i++)
+ numbers[i].accept(this);
+ stack.pop();
+ }
+
+ public void visitLineNumber(LineNumber number) {
+ stack.push(number);
+ number.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitLocalVariableTable(LocalVariableTable table) {
+ stack.push(table);
+ table.accept(visitor);
+
+ LocalVariable[] vars = table.getLocalVariableTable();
+ for (int i = 0; i < vars.length; i++)
+ vars[i].accept(this);
+ stack.pop();
+ }
+
+ public void visitStackMap(StackMap table) {
+ stack.push(table);
+ table.accept(visitor);
+
+ StackMapEntry[] vars = table.getStackMap();
+
+ for (int i = 0; i < vars.length; i++)
+ vars[i].accept(this);
+ stack.pop();
+ }
+
+ public void visitStackMapEntry(StackMapEntry var) {
+ stack.push(var);
+ var.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitLocalVariable(LocalVariable var) {
+ stack.push(var);
+ var.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantPool(ConstantPool cp) {
+ stack.push(cp);
+ cp.accept(visitor);
+
+ Constant[] constants = cp.getConstantPool();
+ for (int i = 1; i < constants.length; i++) {
+ if (constants[i] != null)
+ constants[i].accept(this);
+ }
+
+ stack.pop();
+ }
+
+ public void visitConstantClass(ConstantClass constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantDouble(ConstantDouble constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantFieldref(ConstantFieldref constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantFloat(ConstantFloat constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantInteger(ConstantInteger constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantLong(ConstantLong constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantMethodref(ConstantMethodref constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantMethodHandle(ConstantMethodHandle constant) {
+ throw new IllegalStateException("nyi");
+ }
+
+ public void visitConstantMethodType(ConstantMethodType obj) {
+ throw new IllegalStateException("nyi");
+ }
+
+ public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj) {
+ throw new IllegalStateException("nyi");
+ }
+
+ public void visitBootstrapMethods(BootstrapMethods obj) {
+ throw new IllegalStateException("nyi");
+ }
+
+ public void visitConstantNameAndType(ConstantNameAndType constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantString(ConstantString constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitConstantUtf8(ConstantUtf8 constant) {
+ stack.push(constant);
+ constant.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitInnerClasses(InnerClasses ic) {
+ stack.push(ic);
+ ic.accept(visitor);
+
+ InnerClass[] ics = ic.getInnerClasses();
+ for (int i = 0; i < ics.length; i++)
+ ics[i].accept(this);
+ stack.pop();
+ }
+
+ public void visitInnerClass(InnerClass inner) {
+ stack.push(inner);
+ inner.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitDeprecated(Deprecated attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitSignature(Signature attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ // J5SUPPORT:
+ public void visitEnclosingMethod(EnclosingMethod attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitRuntimeVisibleAnnotations(RuntimeVisAnnos attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitRuntimeInvisibleAnnotations(RuntimeInvisAnnos attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitRuntimeVisibleParameterAnnotations(RuntimeVisParamAnnos attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisParamAnnos attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitRuntimeVisibleTypeAnnotations(RuntimeVisTypeAnnos attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitMethodParameters(MethodParameters attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisTypeAnnos attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitAnnotationDefault(AnnotationDefault attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitLocalVariableTypeTable(LocalVariableTypeTable table) {
+ stack.push(table);
+ table.accept(visitor);
+
+ LocalVariable[] vars = table.getLocalVariableTypeTable();
+ for (int i = 0; i < vars.length; i++)
+ vars[i].accept(this);
+ stack.pop();
+ }
+
+ public void visitSourceFile(SourceFile attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitSynthetic(Synthetic attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitUnknown(Unknown attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
+
+ public void visitModule(Module attribute) {
+ stack.push(attribute);
+ attribute.accept(visitor);
+ stack.pop();
+ }
}
import org.aspectj.apache.bcel.classfile.LocalVariableTypeTable;
import org.aspectj.apache.bcel.classfile.Method;
import org.aspectj.apache.bcel.classfile.MethodParameters;
+import org.aspectj.apache.bcel.classfile.Module;
import org.aspectj.apache.bcel.classfile.Signature;
import org.aspectj.apache.bcel.classfile.SourceFile;
import org.aspectj.apache.bcel.classfile.StackMap;
public void visitUnknown(Unknown obj) {}
public void visitStackMap(StackMap obj) {}
public void visitStackMapEntry(StackMapEntry obj) {}
+ public void visitModule(Module obj) {}
// J5SUPPORT:
public void visitEnclosingMethod(EnclosingMethod obj) {}
} else if (arg.equals("-1.8")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-1.8");
+ } else if (arg.equals("-1.9")) {
+ buildConfig.setBehaveInJava5Way(true);
+ unparsedArgs.add("-1.9");
} else if (arg.equals("-source")) {
if (args.size() > nextArgIndex) {
String level = ((ConfigParser.Arg) args.get(nextArgIndex)).getValue();
if (level.equals("1.5") || level.equals("5") || level.equals("1.6") || level.equals("6") || level.equals("1.7")
- || level.equals("7") || level.equals("8") || level.equals("1.8")) {
+ || level.equals("7") || level.equals("8") || level.equals("1.8") || level.equals("9") || level.equals("1.9")) {
buildConfig.setBehaveInJava5Way(true);
}
unparsedArgs.add("-source");
\ -1.6 -6 -6.0 use 1.6 compliance (-source 1.6 -target 1.6)\n\
\ -1.7 -7 -7.0 use 1.7 compliance (-source 1.7 -target 1.7)\n\
\ -1.8 -8 -8.0 use 1.8 compliance (-source 1.8 -target 1.8)\n\
-\ -source <version> set source level: 1.3 to 1.8 (or 5, 5.0, etc)\n\
-\ -target <version> set classfile target: 1.1 to 1.8 (or 5, 5.0, etc)\n\
+\ -1.9 -9 -9.0 use 1.9 compliance (-source 1.9 -target 1.9)\n\
+\ -source <version> set source level: 1.3 to 1.9 (or 5, 5.0, etc)\n\
+\ -target <version> set classfile target: 1.1 to 1.9 (or 5, 5.0, etc)\n\
\ \n\
\ Warning options:\n\
\ -deprecation + deprecation outside deprecated code\n\
configure.duplicateLog = duplicate log specification: {0}
configure.duplicateRepeat = duplicate repeat specification: {0}
configure.duplicateCompliance = duplicate compliance setting specification: {0}
-configure.source = invalid source option, source is either ''1.3'' or ''1.4'': {0}
+configure.source = invalid source option, source is in the range ''1.3'' > ''1.9'': {0}
configure.duplicateOutputPath = duplicate output path specification: {0}
configure.duplicateBootClasspath = duplicate bootclasspath specification: {0}
configure.invalidDebugOption = invalid debug option: {0}
// override
protected int generateInfoAttributes(ClassFile classFile) {
- List l = new ArrayList(1);
+ List<EclipseAttributeAdapter> l = new ArrayList<>(1);
l.add(new EclipseAttributeAdapter(makeAttribute()));
addDeclarationStartLineAttribute(l, classFile);
-
return classFile.generateMethodInfoAttributes(binding, l);
}
this.receiver = receiver;
this.actualReceiverType = binding.declaringClass;
this.selector = binding.selector;
- constant = Constant.NotAConstant;
+ // constant = Constant.NotAConstant;
}
public void manageSyntheticAccessIfNecessary(BlockScope currentScope) {
} else if (sma.memberValue instanceof NameReference
&& (((NameReference) sma.memberValue).binding instanceof FieldBinding)) {
Binding b = ((NameReference) sma.memberValue).binding;
- Constant c = ((FieldBinding) b).constant;
+ Constant c = ((FieldBinding) b).constant();
return c.stringValue();
}
}
return new String(sLit.source());
} else if (expr instanceof NameReference && (((NameReference) expr).binding instanceof FieldBinding)) {
Binding b = ((NameReference) expr).binding;
- Constant c = ((FieldBinding) b).constant;
+ Constant c = ((FieldBinding) b).constant();
return c.stringValue();
} else {
throw new BCException("Do not know how to recover pointcut definition from " + expr + " (type "
public String getSupplementaryMessageInfo() {
return delegate.getSupplementaryMessageInfo();
}
+
+ @Override
+ public boolean isInfo() {
+ return delegate.isInfo();
+ }
}
public void duplicateMethodInType(AbstractMethodDeclaration methodDecl, boolean equalParameters, int severity) {
}
org.aspectj.ajdt.internal.compiler.CompilerAdapter.setCompilerAdapterFactory(this);
- final Map<?, ?> settings = buildConfig.getOptions().getMap();
+ final Map<String, String> settings = buildConfig.getOptions().getMap();
final BuildArgParser bMain = buildConfig.getBuildArgParser();
final org.aspectj.org.eclipse.jdt.internal.compiler.Compiler compiler = new org.aspectj.org.eclipse.jdt.internal.compiler.Compiler(
// constants for irritant levels
- public static final int InvalidAbsoluteTypeName = IrritantSet.GROUP2 | ASTNode.Bit20;
- public static final int InvalidWildCardTypeName = IrritantSet.GROUP2 | ASTNode.Bit21;
- public static final int UnresolvableMember = IrritantSet.GROUP2 | ASTNode.Bit22;
- public static final int TypeNotExposedToWeaver = IrritantSet.GROUP2 | ASTNode.Bit23;
- public static final int ShadowNotInStructure = IrritantSet.GROUP2 | ASTNode.Bit24;
- public static final int UnmatchedSuperTypeInCall = IrritantSet.GROUP2 | ASTNode.Bit25;
- public static final int CannotImplementLazyTJP = IrritantSet.GROUP2 | ASTNode.Bit26;
- public static final int NeedSerialVersionUIDField = IrritantSet.GROUP2 | ASTNode.Bit27;
- public static final int IncompatibleSerialVersion = IrritantSet.GROUP2 | ASTNode.Bit28;
+ public static final int InvalidAbsoluteTypeName = IrritantSet.GROUP3 | ASTNode.Bit1;
+ public static final int InvalidWildCardTypeName = IrritantSet.GROUP3 | ASTNode.Bit2;
+ public static final int UnresolvableMember = IrritantSet.GROUP3 | ASTNode.Bit3;
+ public static final int TypeNotExposedToWeaver = IrritantSet.GROUP3 | ASTNode.Bit4;
+ public static final int ShadowNotInStructure = IrritantSet.GROUP3 | ASTNode.Bit5;
+ public static final int UnmatchedSuperTypeInCall = IrritantSet.GROUP3 | ASTNode.Bit6;
+ public static final int CannotImplementLazyTJP = IrritantSet.GROUP3 | ASTNode.Bit7;
+ public static final int NeedSerialVersionUIDField = IrritantSet.GROUP3 | ASTNode.Bit8;
+ public static final int IncompatibleSerialVersion = IrritantSet.GROUP3 | ASTNode.Bit9;
public boolean terminateAfterCompilation = false;
public boolean xSerializableAspects = false;
*
* @see org.eclipse.jdt.internal.compiler.impl.CompilerOptions#getMap()
*/
- public Map getMap() {
+ public Map<String,String> getMap() {
Map<String,String> map = super.getMap();
// now add AspectJ additional options
map.put(OPTION_ReportInvalidAbsoluteTypeName, getSeverityString(InvalidAbsoluteTypeName));
}
}
- ((IProgramElement) stack.peek()).addChild(peNode);
+ IProgramElement ipe = (IProgramElement)stack.peek();
+ if (ipe!=null) {
+ // With AspectJ 1.8.9 the type structure must be slightly different as the guard
+ // is required (the null is due to a default constructor).
+ ((IProgramElement) stack.peek()).addChild(peNode);
+ }
stack.push(peNode);
return true;
}
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.ExternalAnnotationStatus;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
/**
* Used to determine if a type has structurally changed during incremental compilation. At the end of compilation we create one of
return typeAnnotations;
}
+ public ITypeAnnotationWalker enrichWithExternalAnnotationsFor(ITypeAnnotationWalker walker, Object member,
+ LookupEnvironment environment) {
+ // TODO[1.8.7] more to do here? In what contexts?
+ return walker;
+ }
+
+ public char[] getModule() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ExternalAnnotationStatus getExternalAnnotationStatus() {
+ return ExternalAnnotationStatus.NOT_EEA_CONFIGURED;
+ }
+
}
\ No newline at end of file
name = name.substring(0,name.length() - ".class".length());
}
char[][] cname = CharOperation.splitOn('.',name.toCharArray());
- NameEnvironmentAnswer answer = nameEnv.findType(cname);
+ // TODO [j9] passing null client/module here...
+ NameEnvironmentAnswer answer = nameEnv.findType(cname,(char[])null);
if (answer == null || !answer.isBinaryType()) {
return null;
} else {
/* *******************************************************************
- * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
+ * Copyright (c) 2002 IBM and other contributors
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * PARC initial implementation
+ * Palo Alto Research Center, Incorporated (PARC)
+ * Andy Clement
* ******************************************************************/
package org.aspectj.ajdt.internal.core.builder;
-//import java.util.HashMap;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.IModule;
+import org.aspectj.org.eclipse.jdt.internal.compiler.env.IModuleLocation;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
import org.aspectj.util.FileUtil;
public class StatefulNameEnvironment implements INameEnvironment {
- private Map classesFromName;
- private Map inflatedClassFilesCache;
- private Set packageNames;
+ private Map<String,File> classesFromName;
+ private Map<String,NameEnvironmentAnswer> inflatedClassFilesCache;
+ private Set<String> packageNames;
private AjState state;
private INameEnvironment baseEnvironment;
- public StatefulNameEnvironment(INameEnvironment baseEnvironment, Map classesFromName, AjState state) {
+ public StatefulNameEnvironment(INameEnvironment baseEnvironment, Map<String,File> classesFromName, AjState state) {
this.classesFromName = classesFromName;
- this.inflatedClassFilesCache = new HashMap();
+ this.inflatedClassFilesCache = new HashMap<String,NameEnvironmentAnswer>();
this.baseEnvironment = baseEnvironment;
this.state = state;
-
- packageNames = new HashSet();
- for (Iterator i = classesFromName.keySet().iterator(); i.hasNext();) {
- String className = (String) i.next();
+ packageNames = new HashSet<String>();
+ for (String className: classesFromName.keySet()) {
addAllPackageNames(className);
}
- // System.err.println(packageNames);
}
private void addAllPackageNames(String className) {
}
}
- public void cleanup() {
- baseEnvironment.cleanup();
- this.classesFromName = Collections.EMPTY_MAP;
- this.packageNames.clear();// = Collections.EMPTY_SET;
- }
-
private NameEnvironmentAnswer findType(String name) {
// pr133532 - ask the state for the type first
IBinaryType seenOnPreviousBuild = state.checkPreviousBuild(name);
} else {
File fileOnDisk = (File) classesFromName.get(name);
// System.err.println("find: " + name + " found: " + cf);
-
- if (fileOnDisk == null)
+ if (fileOnDisk == null) {
return null;
-
+ }
try {
// System.out.println("from cache: " + name);
byte[] bytes = FileUtil.readAsByteArray(fileOnDisk);
}
}
- public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) {
+ @Override
+ public void cleanup() {
+ baseEnvironment.cleanup();
+ this.classesFromName = Collections.emptyMap();
+ this.packageNames.clear();
+ }
+
+ @Override
+ public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName, char[] client) {
NameEnvironmentAnswer ret = findType(new String(CharOperation.concatWith(packageName, typeName, '.')));
- if (ret != null)
+ if (ret != null) {
return ret;
- return baseEnvironment.findType(typeName, packageName);
+ }
+ return baseEnvironment.findType(typeName, packageName, client);
}
- public NameEnvironmentAnswer findType(char[][] compoundName) {
+ @Override
+ public NameEnvironmentAnswer findType(char[][] compoundName, char[] client) {
NameEnvironmentAnswer ret = findType(new String(CharOperation.concatWith(compoundName, '.')));
- if (ret != null)
+ if (ret != null) {
return ret;
- return baseEnvironment.findType(compoundName);
+ }
+ return baseEnvironment.findType(compoundName, client);
}
- public boolean isPackage(char[][] parentPackageName, char[] packageName) {
- if (baseEnvironment.isPackage(parentPackageName, packageName))
+ @Override
+ public boolean isPackage(char[][] parentPackageName, char[] packageName, char[] client) {
+ if (baseEnvironment.isPackage(parentPackageName, packageName, client)) {
return true;
-
+ }
String fullPackageName = new String(CharOperation.concatWith(parentPackageName, packageName, '.'));
return packageNames.contains(fullPackageName);
}
* Needs to be told about changes. The 'added' set is a subset of classNameToFileMap consisting of just those names added during
* this build - to reduce any impact on incremental compilation times.
*/
- public void update(Map classNameToFileMap, Set added) {
- for (Iterator i = added.iterator(); i.hasNext();) {
- String className = (String) i.next();
+ public void update(Map<String,File> classNameToFileMap, Set<String> added) {
+ for (String className: added) {
addAllPackageNames(className);
}
this.classesFromName = classNameToFileMap;
}
+ @Override
+ public void acceptModule(IModule module, IModuleLocation location) {
+ // TODO [j9]
+ baseEnvironment.acceptModule(module, location);
+ }
+
+ @Override
+ public boolean isPackageVisible(char[] pack, char[] source, char[] client) {
+ // TODO [j9]
+ return baseEnvironment.isPackageVisible(pack, source, client);
+ }
+
+ @Override
+ public IModule getModule(char[] name) {
+ // TODO [j9]
+ return baseEnvironment.getModule(name);
+ }
+
+ @Override
+ public IModule getModule(IModuleLocation location) {
+ // TODO [j9]
+ return baseEnvironment.getModule(location);
+ }
+
}
checkCompile("src1/Xlint.java", NO_ERRORS);
}
public void testXlintError() {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-d");
args.add(getSandboxName());
runCompiler(args, new int[] {2});
}
public void testMissingJarError() {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-d");
args.add(getSandboxName());
}
public void testMissingRuntimeError() {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-d");
args.add(getSandboxName());
public void testSizeChanges() {
File f1 = new File(getSandboxName(),"SizeIssues.class");
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-d");
args.add(getSandboxName());
}
public static void makeJar0() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/tracing.jar");
}
public static void makeJar1() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatrace.jar");
public static void makeJarObviousNothing() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatrace0easy.jar");
}
public static void makeJarHardNothing() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatrace0hard.jar");
public static void makeJar1a() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatraceNoweave.jar");
public static void makeJar2() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/dummyAspect.jar");
}
public static void makeTestJars() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
// For PR55341
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
File.pathSeparator + System.getProperty("aspectjrt.path"));
}
public static void makeURLWeavingClassLoaderJars() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
/*
* Vanilla classes
/*
* Woven classes
*/
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" +
File.pathSeparator + System.getProperty("aspectjrt.path"));
/*
* Advice
*/
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" +
File.pathSeparator + System.getProperty("aspectjrt.path"));
/*
* Declare warning advice
*/
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" +
File.pathSeparator + System.getProperty("aspectjrt.path"));
/*
* Around closure advice
*/
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar;../weaver/testdata/ltw-classes.jar" +
File.pathSeparator + System.getProperty("aspectjrt.path"));
private static void buildJarWithClasspath(String outjar,String input,String deps,boolean nodebug) {
System.out.println(" Building "+outjar);
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
if (nodebug) args.add("-g:none");
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
}
public static void makeDuplicateManifestTestJars() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
/*
* injar
}
public static void makeAspectPathTestJars() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
args.clear();
args.add("-classpath");
}
public static void makeAjc11TestJars() throws IOException {
- List args = new ArrayList();
-
+ List<String> args = new ArrayList<>();
args.clear();
args.add("-classpath");
args.add(cp);
}
public static void makeOutjarTestJars() throws IOException {
- List args = new ArrayList();
+ List<String> args = new ArrayList<>();
- /*
- * parent
- */
+ // parent
args.clear();
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
public void testJar1() throws IOException {
String library = getSandboxName() + "/lib.jar";
- List args = new ArrayList();
+ List<String> args = new ArrayList();
args.add("-outjar");
args.add(library);
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
- args = new ArrayList();
+ args = new ArrayList<>();
args.add("-aspectpath");
args.add(library);
public boolean ignoreOptionalProblems() {
return false;
}
+
+ @Override
+ public char[] module() {
+ return null;
+ }
};
TypeDeclaration local = new TypeDeclaration(new CompilationResult(cu, 0, 0, 0));
}
}
if (seeAlsos != null) {
- List extraLocations = message.getExtraSourceLocations();
+ List<ISourceLocation> extraLocations = message.getExtraSourceLocations();
if (extraLocations.size() != seeAlsos.length) {
return false;
}
--- /dev/null
+class AbstractSuperClass<A,B> {}
+interface InterfaceOne {}
+interface InterfaceTwo<A> {}
+class ID {}
+abstract class AbstractTestClass<T> extends AbstractSuperClass<T,ID> implements InterfaceOne, InterfaceTwo<T> {
+}
+class TestType {}
+class ConcreteClass extends AbstractTestClass<TestType> {
+}
--- /dev/null
+public aspect Azpect1 {
+ before(): execution(* main(..)) {
+ System.out.println("Azpect1.before running");
+ }
+}
--- /dev/null
+cd module1
+javac module-info.java Code.java -d .
+jar -cvMf module-one.jar *
+cd ..
--- /dev/null
+package a.b.c;
+public class Code {
+ public static void main(String []argv) {
+ System.out.println("Code.main running");
+ }
+}
--- /dev/null
+module one {
+}
--- /dev/null
+module M.N {
+ requires A.B;
+ requires public C.D;
+
+ exports P.Q;
+ exports R.S to T1.U1, T2.U2;
+
+ uses V.W;
+ provides X.Y with Z1.Z2;
+ provides X.Y with Z3.Z4;
+}
--- /dev/null
+module a {
+}
--- /dev/null
+module b {
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 Contributors
+ * 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:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest;
+
+import org.aspectj.systemtest.ajc190.AllTestsAspectJ190;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests19 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.9");
+ // $JUnit-BEGIN$
+ suite.addTest(AllTestsAspectJ190.suite());
+ suite.addTest(AllTests18.suite());
+ // $JUnit-END$
+ return suite;
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2016 Contributors
+ * 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:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc190;
+
+import java.io.File;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+import junit.framework.Test;
+
+/**
+ * @author Andy Clement
+ */
+public class Ajc190Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ // Weave a module with code that isn't in a module
+ public void testWeaveModule() throws Exception {
+ runTest("weave module");
+ }
+
+ // ---
+
+ public static Test suite() {
+ return XMLBasedAjcTestCase.loadSuite(Ajc190Tests.class);
+ }
+
+ @Override
+ protected File getSpecFile() {
+ return getClassResource("ajc190.xml");
+ }
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Contributors
+ * 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:
+ * Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc190;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.aspectj.systemtest.apt.AptTests;
+
+public class AllTestsAspectJ190 {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("AspectJ 1.8.5 tests");
+ // $JUnit-BEGIN$
+ suite.addTest(Ajc190Tests.suite());
+ suite.addTest(AptTests.suite());
+ // $JUnit-END$
+ return suite;
+ }
+}
--- /dev/null
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+ <ajc-test dir="bugs190/modules" title="weave module">
+ <compile files="aspect1/Azpect1.java" inpath="module1/module-one.jar" outjar="runner.jar" options="-1.8"/>
+ <java classpath="runner.jar" class="a.b.c.Code"/>
+ </ajc-test>
+
+</suite>
import org.aspectj.systemtest.AllTests14;
import org.aspectj.systemtest.AllTests17;
import org.aspectj.systemtest.AllTests18;
+import org.aspectj.systemtest.AllTests19;
import org.aspectj.util.LangUtil;
public class TestsModuleTests extends TestCase {
String name = TestsModuleTests.class.getName();
TestSuite suite = new TestSuite(name);
// compiler tests, wrapped for JUnit
- if (LangUtil.is18VMOrGreater()) {
+ if (LangUtil.is19VMOrGreater()) {
+ suite.addTest(AllTests19.suite());
+ } else if (LangUtil.is18VMOrGreater()) {
suite.addTest(AllTests18.suite());
} else if (LangUtil.is15VMOrGreater()) {
// suite.addTest(AllTests15.suite());
* ******************************************************************/
package org.aspectj.weaver;
-import java.util.List;
-
import org.aspectj.weaver.bcel.BcelWorld;
import junit.framework.TestCase;
import junit.framework.TestCase;
+import java.util.List;
+
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.World;
+import org.aspectj.weaver.patterns.ConcreteCflowPointcut;
public class ReflectionWorldTest extends TestCase {
assertEquals("int", UnresolvedType.INT, world.resolve(int.class));
assertEquals("void", UnresolvedType.VOID, world.resolve(void.class));
}
+
+ static class AbstractSuperClass<A,B> {}
+ static interface InterfaceOne {}
+ static interface InterfaceTwo<A> {}
+ static class ID {}
+ static abstract class AbstractTestClass<T> extends AbstractSuperClass<T,ID> implements InterfaceOne, InterfaceTwo<T> {
+
+ }
+ static class TestType {}
+// static class ConcreteClass extends AbstractTestClass<TestType> {
+ static class ConcreteClass extends AbstractTestClass<List<TestType>> {
+ }
+
+ static class Bar extends ConcreteClass {}
+
+ public void testGenerics() {
+ ReflectionWorld world = new ReflectionWorld(getClass().getClassLoader());
+// world.lookupOrCreateName(UnresolvedType.forName(AbstractTestClass.class.getName()));
+// ResolvedType resolvedType = world.resolve(AbstractTestClass.class);
+ JavaLangTypeToResolvedTypeConverter converter = new JavaLangTypeToResolvedTypeConverter(world);
+ ResolvedType resolvedType2 = converter.fromType(ConcreteClass.class);
+ }
}