Skip to content
Commits on Source (3)
......@@ -84,6 +84,8 @@ public interface Constants {
public final static short MINOR_1_9 = 0;
public final static short MAJOR_10 = 54;
public final static short MINOR_10 = 0;
public final static short MAJOR_11 = 55;
public final static short MINOR_11 = 0;
// Defaults
public final static short MAJOR = MAJOR_1_1;
public final static short MINOR = MINOR_1_1;
......@@ -155,9 +157,9 @@ public interface Constants {
public final static byte CONSTANT_MethodHandle = 15;
public final static byte CONSTANT_MethodType = 16;
public final static byte CONSTANT_Dynamic = 17;
public final static byte CONSTANT_InvokeDynamic = 18;
// J9:
public final static byte CONSTANT_Module = 19;
public final static byte CONSTANT_Package = 20;
......@@ -650,7 +652,11 @@ public interface Constants {
public static final byte ATTR_MODULE_PACKAGES = 24;
public static final byte ATTR_MODULE_MAIN_CLASS = 25;
public static final short KNOWN_ATTRIBUTES = 26;
// J11:
public static final byte ATTR_NEST_HOST = 26;
public static final byte ATTR_NEST_MEMBERS = 27;
public static final short KNOWN_ATTRIBUTES = 28;
public static final String[] ATTRIBUTE_NAMES = {
"SourceFile", "ConstantValue", "Code", "Exceptions", "LineNumberTable", "LocalVariableTable",
......@@ -658,7 +664,7 @@ public interface Constants {
"RuntimeVisibleAnnotations", "RuntimeInvisibleAnnotations", "RuntimeVisibleParameterAnnotations",
"RuntimeInvisibleParameterAnnotations", "LocalVariableTypeTable", "EnclosingMethod",
"AnnotationDefault","BootstrapMethods", "RuntimeVisibleTypeAnnotations", "RuntimeInvisibleTypeAnnotations",
"MethodParameters", "Module", "ModulePackages", "ModuleMainClass"
"MethodParameters", "Module", "ModulePackages", "ModuleMainClass", "NestHost", "NestMembers"
};
/**
......
......@@ -173,6 +173,10 @@ public abstract class Attribute implements Cloneable, Node, Serializable {
return new ModulePackages(idx, len, file, cpool);
case Constants.ATTR_MODULE_MAIN_CLASS:
return new ModuleMainClass(idx, len, file, cpool);
case Constants.ATTR_NEST_HOST:
return new NestHost(idx, len, file, cpool);
case Constants.ATTR_NEST_MEMBERS:
return new NestMembers(idx, len, file, cpool);
default:
throw new IllegalStateException();
}
......@@ -203,6 +207,7 @@ public abstract class Attribute implements Cloneable, Node, Serializable {
return Constants.ATTRIBUTE_NAMES[tag];
}
@Override
public abstract void accept(ClassVisitor v);
}
......@@ -99,6 +99,8 @@ public interface ClassVisitor {
public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj);
public void visitConstantDynamic(ConstantDynamic obj);
public void visitConstantPool(ConstantPool obj);
public void visitConstantString(ConstantString obj);
......@@ -171,4 +173,8 @@ public interface ClassVisitor {
public void visitModule(Module module);
public void visitModulePackages(ModulePackages modulePackage);
public void visitModuleMainClass(ModuleMainClass moduleMainClass);
// J11:
public void visitNestHost(NestHost nestHost);
public void visitNestMembers(NestMembers nestMembers);
}
......@@ -135,8 +135,12 @@ public abstract class Constant implements Cloneable, Node {
return new ConstantMethodType(dis);
case Constants.CONSTANT_InvokeDynamic:
return new ConstantInvokeDynamic(dis);
case Constants.CONSTANT_Module: return new ConstantModule(dis);
case Constants.CONSTANT_Package: return new ConstantPackage(dis);
case Constants.CONSTANT_Module:
return new ConstantModule(dis);
case Constants.CONSTANT_Package:
return new ConstantPackage(dis);
case Constants.CONSTANT_Dynamic:
return new ConstantDynamic(dis);
default:
throw new ClassFormatException("Invalid byte tag in constant pool: " + b);
}
......
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache BCEL" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache BCEL", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.aspectj.apache.bcel.classfile;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.aspectj.apache.bcel.Constants;
/**
* This class is derived from the abstract <A HREF="org.aspectj.apache.bcel.classfile.Constant.html">Constant</A> class and
* represents a reference to the name and signature of a field or method.
*
* http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.10
*
* @author Andy Clement
* @see Constant
*/
public final class ConstantDynamic extends Constant {
private final int bootstrapMethodAttrIndex;
private final int nameAndTypeIndex;
ConstantDynamic(DataInputStream file) throws IOException {
this(file.readUnsignedShort(), file.readUnsignedShort());
}
public ConstantDynamic(int readUnsignedShort, int nameAndTypeIndex) {
super(Constants.CONSTANT_InvokeDynamic);
this.bootstrapMethodAttrIndex = readUnsignedShort;
this.nameAndTypeIndex = nameAndTypeIndex;
}
@Override
public final void dump(DataOutputStream file) throws IOException {
file.writeByte(tag);
file.writeShort(bootstrapMethodAttrIndex);
file.writeShort(nameAndTypeIndex);
}
public final int getNameAndTypeIndex() {
return nameAndTypeIndex;
}
public final int getBootstrapMethodAttrIndex() {
return bootstrapMethodAttrIndex;
}
@Override
public final String toString() {
return super.toString() + "(bootstrapMethodAttrIndex=" + bootstrapMethodAttrIndex + ",nameAndTypeIndex=" + nameAndTypeIndex + ")";
}
@Override
public String getValue() {
return toString();
}
@Override
public void accept(ClassVisitor v) {
v.visitConstantDynamic(this);
}
}
package org.aspectj.apache.bcel.classfile;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache BCEL" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache BCEL", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.aspectj.apache.bcel.Constants;
/**
* https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.7.28
*
* @see Attribute
*/
public final class NestHost extends Attribute {
private int hostClassIndex;
public NestHost(NestHost c) {
this(c.getNameIndex(), c.getLength(), c.getHostClassIndex(), c.getConstantPool());
}
public NestHost(int nameIndex, int length, int hostClassIndex, ConstantPool cp) {
super(Constants.ATTR_NEST_MEMBERS, nameIndex, length, cp);
this.hostClassIndex = hostClassIndex;
}
NestHost(int nameIndex, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
this(nameIndex, length, 0, constant_pool);
hostClassIndex = file.readUnsignedShort();
}
@Override
public void accept(ClassVisitor v) {
v.visitNestHost(this);
}
@Override
public final void dump(DataOutputStream file) throws IOException {
super.dump(file);
file.writeShort(hostClassIndex);
}
public final int getHostClassIndex() {
return hostClassIndex;
}
public final void setHostClassIndex(int hostClassIndex) {
this.hostClassIndex = hostClassIndex;
}
public final String getHostClassName() {
ConstantClass constantClass = (ConstantClass)cpool.getConstant(hostClassIndex,Constants.CONSTANT_Class);
return constantClass.getClassname(cpool);
}
@Override
public final String toString() {
StringBuffer buf = new StringBuffer();
buf.append("NestHost(");
ConstantClass constantClass = (ConstantClass)cpool.getConstant(hostClassIndex,Constants.CONSTANT_Class);
buf.append(constantClass.getClassname(cpool));
buf.append(")");
return buf.toString();
}
}
package org.aspectj.apache.bcel.classfile;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache BCEL" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache BCEL", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.aspectj.apache.bcel.Constants;
/**
* https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.7.29
*
* @see Attribute
*/
public final class NestMembers extends Attribute {
private int numberOfClasses;
private int[] classes; // CONSTANT_Class_info references
public NestMembers(NestMembers c) {
this(c.getNameIndex(), c.getLength(), c.getClasses(), c.getConstantPool());
}
public NestMembers(int nameIndex, int length, int[] classes, ConstantPool cp) {
super(Constants.ATTR_NEST_MEMBERS, nameIndex, length, cp);
setClasses(classes);
}
NestMembers(int nameIndex, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
this(nameIndex, length, (int[]) null, constant_pool);
numberOfClasses = file.readUnsignedShort();
classes = new int[numberOfClasses];
for (int i = 0; i < numberOfClasses; i++) {
classes[i] = file.readUnsignedShort();
}
}
@Override
public void accept(ClassVisitor v) {
v.visitNestMembers(this);
}
@Override
public final void dump(DataOutputStream file) throws IOException {
super.dump(file);
file.writeShort(numberOfClasses);
for (int i = 0; i < numberOfClasses; i++) {
file.writeShort(classes[i]);
}
}
public final int[] getClasses() {
return classes;
}
public final void setClasses(int[] inner_classes) {
this.classes = inner_classes;
numberOfClasses = (inner_classes == null) ? 0 : inner_classes.length;
}
public final String[] getClassesNames() {
String[] result = new String[numberOfClasses];
for (int i = 0; i < numberOfClasses; i++) {
ConstantClass constantClass = (ConstantClass)cpool.getConstant(classes[i],Constants.CONSTANT_Class);
result[i] = constantClass.getClassname(cpool);
}
return result;
}
@Override
public final String toString() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < numberOfClasses; i++) {
ConstantClass constantClass = (ConstantClass)cpool.getConstant(classes[i],Constants.CONSTANT_Class);
buf.append(constantClass.getClassname(cpool)).append(" ");
}
return "NestMembers("+buf.toString().trim()+")";
}
}
......@@ -226,7 +226,7 @@ public class ClassPath implements Serializable {
}
// On Java9 the sun.boot.class.path won't be set. System classes accessible through JRT filesystem
if (vm_version.startsWith("9") || vm_version.startsWith("10")) {
if (vm_version.startsWith("9") || vm_version.startsWith("10") || vm_version.startsWith("11")) {
buf.insert(0, File.pathSeparatorChar);
buf.insert(0, System.getProperty("java.home") + File.separator + "lib" + File.separator + JRT_FS);
}
......
......@@ -59,11 +59,13 @@ import org.aspectj.apache.bcel.classfile.AnnotationDefault;
import org.aspectj.apache.bcel.classfile.Attribute;
import org.aspectj.apache.bcel.classfile.AttributeUtils;
import org.aspectj.apache.bcel.classfile.BootstrapMethods;
import org.aspectj.apache.bcel.classfile.ClassVisitor;
import org.aspectj.apache.bcel.classfile.Code;
import org.aspectj.apache.bcel.classfile.CodeException;
import org.aspectj.apache.bcel.classfile.Constant;
import org.aspectj.apache.bcel.classfile.ConstantClass;
import org.aspectj.apache.bcel.classfile.ConstantDouble;
import org.aspectj.apache.bcel.classfile.ConstantDynamic;
import org.aspectj.apache.bcel.classfile.ConstantFieldref;
import org.aspectj.apache.bcel.classfile.ConstantFloat;
import org.aspectj.apache.bcel.classfile.ConstantInteger;
......@@ -97,13 +99,14 @@ import org.aspectj.apache.bcel.classfile.MethodParameters;
import org.aspectj.apache.bcel.classfile.Module;
import org.aspectj.apache.bcel.classfile.ModuleMainClass;
import org.aspectj.apache.bcel.classfile.ModulePackages;
import org.aspectj.apache.bcel.classfile.NestHost;
import org.aspectj.apache.bcel.classfile.NestMembers;
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.StackMapEntry;
import org.aspectj.apache.bcel.classfile.Synthetic;
import org.aspectj.apache.bcel.classfile.Unknown;
import org.aspectj.apache.bcel.classfile.ClassVisitor;
import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisAnnos;
import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisParamAnnos;
import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisTypeAnnos;
......@@ -170,6 +173,7 @@ public class DescendingVisitor implements ClassVisitor {
clazz.accept(this);
}
@Override
public void visitJavaClass(JavaClass clazz) {
stack.push(clazz);
clazz.accept(visitor);
......@@ -188,6 +192,7 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitField(Field field) {
stack.push(field);
field.accept(visitor);
......@@ -196,12 +201,14 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitConstantValue(ConstantValue cv) {
stack.push(cv);
cv.accept(visitor);
stack.pop();
}
@Override
public void visitMethod(Method method) {
stack.push(method);
method.accept(visitor);
......@@ -209,12 +216,14 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitExceptionTable(ExceptionTable table) {
stack.push(table);
table.accept(visitor);
stack.pop();
}
@Override
public void visitCode(Code code) {
stack.push(code);
code.accept(visitor);
......@@ -229,12 +238,14 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitCodeException(CodeException ce) {
stack.push(ce);
ce.accept(visitor);
stack.pop();
}
@Override
public void visitLineNumberTable(LineNumberTable table) {
stack.push(table);
table.accept(visitor);
......@@ -245,12 +256,14 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitLineNumber(LineNumber number) {
stack.push(number);
number.accept(visitor);
stack.pop();
}
@Override
public void visitLocalVariableTable(LocalVariableTable table) {
stack.push(table);
table.accept(visitor);
......@@ -261,6 +274,7 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitStackMap(StackMap table) {
stack.push(table);
table.accept(visitor);
......@@ -272,18 +286,21 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitStackMapEntry(StackMapEntry var) {
stack.push(var);
var.accept(visitor);
stack.pop();
}
@Override
public void visitLocalVariable(LocalVariable var) {
stack.push(var);
var.accept(visitor);
stack.pop();
}
@Override
public void visitConstantPool(ConstantPool cp) {
stack.push(cp);
cp.accept(visitor);
......@@ -297,100 +314,123 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitConstantClass(ConstantClass constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantDouble(ConstantDouble constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantFieldref(ConstantFieldref constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantFloat(ConstantFloat constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantInteger(ConstantInteger constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantLong(ConstantLong constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantMethodref(ConstantMethodref constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantMethodHandle(ConstantMethodHandle constant) {
throw new IllegalStateException("nyi");
}
@Override
public void visitConstantMethodType(ConstantMethodType obj) {
throw new IllegalStateException("nyi");
}
@Override
public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj) {
throw new IllegalStateException("nyi");
}
@Override
public void visitConstantDynamic(ConstantDynamic obj) {
throw new IllegalStateException("nyi");
}
@Override
public void visitBootstrapMethods(BootstrapMethods obj) {
throw new IllegalStateException("nyi");
}
@Override
public void visitConstantNameAndType(ConstantNameAndType constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantString(ConstantString constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantModule(ConstantModule constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantPackage(ConstantPackage constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitConstantUtf8(ConstantUtf8 constant) {
stack.push(constant);
constant.accept(visitor);
stack.pop();
}
@Override
public void visitInnerClasses(InnerClasses ic) {
stack.push(ic);
ic.accept(visitor);
......@@ -401,18 +441,21 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitInnerClass(InnerClass inner) {
stack.push(inner);
inner.accept(visitor);
stack.pop();
}
@Override
public void visitDeprecated(Deprecated attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitSignature(Signature attribute) {
stack.push(attribute);
attribute.accept(visitor);
......@@ -420,60 +463,70 @@ public class DescendingVisitor implements ClassVisitor {
}
// J5SUPPORT:
@Override
public void visitEnclosingMethod(EnclosingMethod attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitRuntimeVisibleAnnotations(RuntimeVisAnnos attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitRuntimeInvisibleAnnotations(RuntimeInvisAnnos attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitRuntimeVisibleParameterAnnotations(RuntimeVisParamAnnos attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisParamAnnos attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitRuntimeVisibleTypeAnnotations(RuntimeVisTypeAnnos attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitMethodParameters(MethodParameters attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisTypeAnnos attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitAnnotationDefault(AnnotationDefault attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitLocalVariableTypeTable(LocalVariableTypeTable table) {
stack.push(table);
table.accept(visitor);
......@@ -484,39 +537,59 @@ public class DescendingVisitor implements ClassVisitor {
stack.pop();
}
@Override
public void visitSourceFile(SourceFile attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitSynthetic(Synthetic attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitUnknown(Unknown attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitModule(Module attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitModulePackages(ModulePackages attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitModuleMainClass(ModuleMainClass attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitNestHost(NestHost attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
@Override
public void visitNestMembers(NestMembers attribute) {
stack.push(attribute);
attribute.accept(visitor);
stack.pop();
}
}
......@@ -55,10 +55,12 @@ package org.aspectj.apache.bcel.verifier;
import org.aspectj.apache.bcel.classfile.AnnotationDefault;
import org.aspectj.apache.bcel.classfile.BootstrapMethods;
import org.aspectj.apache.bcel.classfile.ClassVisitor;
import org.aspectj.apache.bcel.classfile.Code;
import org.aspectj.apache.bcel.classfile.CodeException;
import org.aspectj.apache.bcel.classfile.ConstantClass;
import org.aspectj.apache.bcel.classfile.ConstantDouble;
import org.aspectj.apache.bcel.classfile.ConstantDynamic;
import org.aspectj.apache.bcel.classfile.ConstantFieldref;
import org.aspectj.apache.bcel.classfile.ConstantFloat;
import org.aspectj.apache.bcel.classfile.ConstantInteger;
......@@ -92,13 +94,14 @@ import org.aspectj.apache.bcel.classfile.MethodParameters;
import org.aspectj.apache.bcel.classfile.Module;
import org.aspectj.apache.bcel.classfile.ModuleMainClass;
import org.aspectj.apache.bcel.classfile.ModulePackages;
import org.aspectj.apache.bcel.classfile.NestHost;
import org.aspectj.apache.bcel.classfile.NestMembers;
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.StackMapEntry;
import org.aspectj.apache.bcel.classfile.Synthetic;
import org.aspectj.apache.bcel.classfile.Unknown;
import org.aspectj.apache.bcel.classfile.ClassVisitor;
import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisAnnos;
import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisParamAnnos;
import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisTypeAnnos;
......@@ -119,62 +122,118 @@ import org.aspectj.apache.bcel.classfile.annotation.RuntimeVisTypeAnnos;
public class EmptyClassVisitor implements ClassVisitor {
protected EmptyClassVisitor() { }
@Override
public void visitCode(Code obj) {}
@Override
public void visitCodeException(CodeException obj) {}
@Override
public void visitConstantClass(ConstantClass obj) {}
@Override
public void visitConstantDouble(ConstantDouble obj) {}
@Override
public void visitConstantFieldref(ConstantFieldref obj) {}
@Override
public void visitConstantFloat(ConstantFloat obj) {}
@Override
public void visitConstantInteger(ConstantInteger obj) {}
@Override
public void visitConstantInterfaceMethodref(ConstantInterfaceMethodref obj) {}
@Override
public void visitConstantLong(ConstantLong obj) {}
@Override
public void visitConstantMethodref(ConstantMethodref obj) {}
@Override
public void visitConstantMethodHandle(ConstantMethodHandle obj) {}
@Override
public void visitConstantMethodType(ConstantMethodType obj) {}
@Override
public void visitConstantInvokeDynamic(ConstantInvokeDynamic obj) {}
@Override
public void visitConstantNameAndType(ConstantNameAndType obj) {}
@Override
public void visitConstantPool(ConstantPool obj) {}
@Override
public void visitConstantString(ConstantString obj) {}
@Override
public void visitConstantModule(ConstantModule obj) {}
@Override
public void visitConstantPackage(ConstantPackage obj) {}
@Override
public void visitConstantUtf8(ConstantUtf8 obj) {}
@Override
public void visitConstantValue(ConstantValue obj) {}
@Override
public void visitDeprecated(Deprecated obj) {}
@Override
public void visitExceptionTable(ExceptionTable obj) {}
@Override
public void visitField(Field obj) {}
@Override
public void visitInnerClass(InnerClass obj) {}
@Override
public void visitInnerClasses(InnerClasses obj) {}
@Override
public void visitJavaClass(JavaClass obj) {}
@Override
public void visitLineNumber(LineNumber obj) {}
@Override
public void visitBootstrapMethods(BootstrapMethods obj) {}
@Override
public void visitLineNumberTable(LineNumberTable obj) {}
@Override
public void visitLocalVariable(LocalVariable obj) {}
@Override
public void visitLocalVariableTable(LocalVariableTable obj) {}
@Override
public void visitMethod(Method obj) {}
@Override
public void visitSignature(Signature obj) {}
@Override
public void visitSourceFile(SourceFile obj) {}
@Override
public void visitSynthetic(Synthetic obj) {}
@Override
public void visitUnknown(Unknown obj) {}
@Override
public void visitStackMap(StackMap obj) {}
@Override
public void visitStackMapEntry(StackMapEntry obj) {}
// J5:
@Override
public void visitEnclosingMethod(EnclosingMethod obj) {}
@Override
public void visitRuntimeVisibleAnnotations(RuntimeVisAnnos attribute) {}
@Override
public void visitRuntimeInvisibleAnnotations(RuntimeInvisAnnos attribute) {}
@Override
public void visitRuntimeVisibleParameterAnnotations(RuntimeVisParamAnnos attribute) {}
@Override
public void visitRuntimeInvisibleParameterAnnotations(RuntimeInvisParamAnnos attribute) {}
@Override
public void visitAnnotationDefault(AnnotationDefault attribute) {}
@Override
public void visitLocalVariableTypeTable(LocalVariableTypeTable obj) {}
// J8:
@Override
public void visitRuntimeVisibleTypeAnnotations(RuntimeVisTypeAnnos attribute) {}
@Override
public void visitRuntimeInvisibleTypeAnnotations(RuntimeInvisTypeAnnos attribute) {}
@Override
public void visitMethodParameters(MethodParameters attribute) {}
// J9:
@Override
public void visitModule(Module attribute) {}
@Override
public void visitModulePackages(ModulePackages attribute) {}
@Override
public void visitModuleMainClass(ModuleMainClass attribute) {}
// J11:
@Override public void visitConstantDynamic(ConstantDynamic attribute) {}
@Override public void visitNestHost(NestHost attribute) { }
@Override public void visitNestMembers(NestMembers attribute) { }
}
aspectj (1.9.2~rc2-1) unstable; urgency=medium
* Team upload.
* New upstream release (Closes: #909251)
- Refreshed the patches
-- Emmanuel Bourg <ebourg@apache.org> Wed, 03 Oct 2018 18:07:20 +0200
aspectj (1.9.1-1) unstable; urgency=medium
* Team upload.
......
......@@ -34,3 +34,21 @@ Forwarded: no
/**
* Uses asm to add the stack map attribute to methods in a class. The class is passed in as pure byte data and then a reader/writer
@@ -54,7 +54,7 @@
private static class AspectJClassVisitor extends ClassVisitor {
public AspectJClassVisitor(ClassVisitor classwriter) {
- super(Opcodes.ASM7, classwriter);
+ super(Opcodes.ASM6, classwriter);
}
@Override
@@ -67,7 +67,7 @@
// created by a ClassWriter (see top level class comment)
static class AJMethodVisitor extends MethodVisitor {
public AJMethodVisitor(MethodVisitor mv) {
- super(Opcodes.ASM7,mv);
+ super(Opcodes.ASM6,mv);
}
}
......@@ -11,7 +11,12 @@ package org.aspectj.weaver.loadtime;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.invoke.MethodType;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.ProtectionDomain;
......@@ -1043,49 +1048,145 @@ public class ClassLoaderWeavingAdaptor extends WeavingAdaptor {
return unsafe;
}
private void defineClass(ClassLoader loader, String name, byte[] bytes) {
if (trace.isTraceEnabled()) {
trace.enter("defineClass", this, new Object[] { loader, name, bytes });
}
Object clazz = null;
debug("generating class '" + name + "'");
private static Method bindTo_Method, invokeWithArguments_Method = null;
private static Object defineClassMethodHandle = null;
private static Boolean initializedForJava11 = false;
// In order to let this code compile on earlier versions of Java (8), use reflection to discover the elements
// we need to define classes.
private static synchronized void initializeForJava11() {
if (initializedForJava11) return;
try {
clazz = getUnsafe().defineClass(name, bytes, 0, bytes.length, loader, null);
} catch (LinkageError le) {
// likely thrown due to defining something that already exists?
// Old comments from before moving to Unsafe.defineClass():
// is already defined (happens for X$ajcMightHaveAspect interfaces since aspects are reweaved)
// TODO maw I don't think this is OK and
// MethodType defineClassMethodType = MethodType.methodType(Class.class, new Class[]{String.class, byte[].class, int.class, int.class});
Class<?> methodType_Class = Class.forName("java.lang.invoke.MethodType");
Method methodTypeMethodOnMethodTypeClass = methodType_Class.getDeclaredMethod("methodType", Class.class,Class[].class);
methodTypeMethodOnMethodTypeClass.setAccessible(true);
Object defineClassMethodType = methodTypeMethodOnMethodTypeClass.invoke(null, Class.class, new Class[] {String.class,byte[].class,int.class,int.class});
// MethodHandles.Lookup methodHandlesLookup = MethodHandles.lookup();
Class<?> methodHandles_Class = Class.forName("java.lang.invoke.MethodHandles");
Method lookupMethodOnMethodHandlesClass = methodHandles_Class.getDeclaredMethod("lookup");
lookupMethodOnMethodHandlesClass.setAccessible(true);
Object methodHandlesLookup = lookupMethodOnMethodHandlesClass.invoke(null);
// MethodHandles.Lookup lookup = MethodHandles.privateLookupIn(ClassLoader.class, baseLookup);
Class<?> methodHandlesLookup_Class = Class.forName("java.lang.invoke.MethodHandles$Lookup");
Method privateLookupMethodOnMethodHandlesClass = methodHandles_Class.getDeclaredMethod("privateLookupIn",Class.class,methodHandlesLookup_Class);
privateLookupMethodOnMethodHandlesClass.setAccessible(true);
Object lookup = privateLookupMethodOnMethodHandlesClass.invoke(null, ClassLoader.class, methodHandlesLookup);
// MethodHandle defineClassMethodHandle = lookup.findVirtual(ClassLoader.class, "defineClass", defineClassMethodType);
Method findVirtual_Method = methodHandlesLookup_Class.getDeclaredMethod("findVirtual", Class.class,String.class,methodType_Class);
findVirtual_Method.setAccessible(true);
defineClassMethodHandle = findVirtual_Method.invoke(lookup, ClassLoader.class, "defineClass",defineClassMethodType);
// clazz = defineClassMethodHandle.bindTo(loader).invokeWithArguments(name, bytes, 0, bytes.length);
Class<?> methodHandle_Class = Class.forName("java.lang.invoke.MethodHandle");
bindTo_Method = methodHandle_Class.getDeclaredMethod("bindTo", Object.class);
invokeWithArguments_Method = methodHandle_Class.getDeclaredMethod("invokeWithArguments",Object[].class);
initializedForJava11 = true;
} catch (Exception e) {
e.printStackTrace(System.err);
warn("define generated class failed", e);
}
if (trace.isTraceEnabled()) {
trace.exit("defineClass", clazz);
e.printStackTrace();
}
}
private void defineClass(ClassLoader loader, String name, byte[] bytes, ProtectionDomain protectionDomain) {
if (trace.isTraceEnabled()) {
trace.enter("defineClass", this, new Object[] { loader, name, bytes, protectionDomain });
trace.enter("defineClass", this, new Object[] { loader, name, bytes });
}
Object clazz = null;
debug("generating class '" + name + "'");
if (LangUtil.is11VMOrGreater()) {
try {
if (!initializedForJava11) {
initializeForJava11();
}
// Do this: clazz = defineClassMethodHandle.bindTo(loader).invokeWithArguments(name, bytes, 0, bytes.length);
Object o = bindTo_Method.invoke(defineClassMethodHandle,loader);
clazz = invokeWithArguments_Method.invoke(o, new Object[] {new Object[] {name, bytes, 0, bytes.length}});
} catch (Throwable t) {
t.printStackTrace(System.err);
warn("define generated class failed", t);
}
} else {
try {
getUnsafe().defineClass(name, bytes, 0, bytes.length, loader, protectionDomain);
if (defineClassMethod == null) {
synchronized (lock) {
getUnsafe();
defineClassMethod =
Unsafe.class.getDeclaredMethod("defineClass", String.class,byte[].class,Integer.TYPE,Integer.TYPE, ClassLoader.class,ProtectionDomain.class);
}
}
defineClassMethod.setAccessible(true);
clazz = defineClassMethod.invoke(getUnsafe(), name,bytes,0,bytes.length,loader,protectionDomain);
} catch (LinkageError le) {
le.printStackTrace();
// likely thrown due to defining something that already exists?
// Old comments from before moving to Unsafe.defineClass():
// is already defined (happens for X$ajcMightHaveAspect interfaces since aspects are reweaved)
// TODO maw I don't think this is OK and
} catch (Exception e) {
e.printStackTrace(System.err);
warn("define generated class failed", e);
}
}
if (trace.isTraceEnabled()) {
trace.exit("defineClass", clazz);
}
}
static Method defineClassMethod;
private static String lock = "lock";
// /*
// This method is equivalent to the following code but use reflection to compile on Java 7:
// MethodHandles.Lookup baseLookup = MethodHandles.lookup();
// MethodHandles.Lookup lookup = MethodHandles.privateLookupIn(ClassLoader.class, baseLookup);
// MethodHandle defineClassMethodHandle = lookup.findVirtual(ClassLoader.class, "defineClass", defineClassMethodType);
// handle.bindTo(classLoader).invokeWithArguments(className, classBytes, 0, classBytes.length));
// */
//@Override
//@SuppressWarnings("unchecked")
//public <T> Class<T> defineClass(ClassLoader classLoader, String className, byte[] classBytes) {
// Object baseLookup = methodHandlesLookup.invoke(null);
// Object lookup = methodHandlesPrivateLookupIn.invoke(null, ClassLoader.class, baseLookup);
// MethodHandle defineClassMethodHandle = (MethodHandle) lookupFindVirtual.invoke(lookup, ClassLoader.class, "defineClass", defineClassMethodType);
// try {
// return Cast.uncheckedCast(defineClassMethodHandle.bindTo(classLoader).invokeWithArguments(className, classBytes, 0, classBytes.length));
// } catch (Throwable throwable) {
// throw new RuntimeException(throwable);
// return (Class) defineClassMethodHandle.bindTo(classLoader).invokeWithArguments(className, classBytes, 0, classBytes.length);
// } catch (Throwable e) {
// throw new RuntimeException(e);
// }
//}
private void defineClass(ClassLoader loader, String name, byte[] bytes){
defineClass(loader,name,bytes,null);//, ProtectionDomain protectionDomain) {
}
// if (trace.isTraceEnabled()) {
// trace.enter("defineClass", this, new Object[] { loader, name, bytes, protectionDomain });
// }
// Object clazz = null;
// debug("generating class '" + name + "'");
// try {
// getUnsafe().defineClass(name, bytes, 0, bytes.length, loader, protectionDomain);
// } catch (LinkageError le) {
// // likely thrown due to defining something that already exists?
// // Old comments from before moving to Unsafe.defineClass():
// // is already defined (happens for X$ajcMightHaveAspect interfaces since aspects are reweaved)
// // TODO maw I don't think this is OK and
// } catch (Exception e) {
// warn("define generated class failed", e);
// }
//
// if (trace.isTraceEnabled()) {
// trace.exit("defineClass", clazz);
// }
// }
}
\ No newline at end of file
......@@ -355,9 +355,7 @@ public class ConcreteAspectCodeGen {
}
/**
* Build the bytecode for the concrete aspect
*
* @return concrete aspect bytecode
* @return the bytecode for the concrete aspect
*/
public byte[] getBytes() {
if (!isValid) {
......
......@@ -4,8 +4,8 @@
The -Xlintfile:lint.properties allows fine-grained control. In tools.jar, see
org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy.
### AspectJ-specific messages
compiler.name = AspectJ Compiler 1.9.1
compiler.version = Eclipse Compiler #abe06abe4ce1(Apr2018), 3.14
compiler.name = AspectJ Compiler 1.9.2
compiler.version = Eclipse Compiler #BETA_JAVA11(20Sep2018), 3.14
compiler.copyright =
......
......@@ -54,6 +54,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalVariableBinding
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedMethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
......@@ -68,6 +69,7 @@ import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.ResolvedTypeMunger;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.patterns.Declare;
import org.aspectj.weaver.patterns.DeclareAnnotation;
import org.aspectj.weaver.patterns.DeclareParents;
import org.aspectj.weaver.patterns.DeclareSoft;
......@@ -489,8 +491,8 @@ public class AjProblemReporter extends ProblemReporter {
if (typeDecl.enclosingType != null && (typeDecl.enclosingType instanceof AspectDeclaration)) {
AspectDeclaration ad = (AspectDeclaration) typeDecl.enclosingType;
if (ad.concreteName != null) {
List declares = ad.concreteName.declares;
for (Iterator iter = declares.iterator(); iter.hasNext();) {
List<Declare> declares = ad.concreteName.declares;
for (Iterator<Declare> iter = declares.iterator(); iter.hasNext();) {
Object dec = iter.next();
if (dec instanceof DeclareParents) {
DeclareParents decp = (DeclareParents) dec;
......@@ -515,7 +517,8 @@ public class AjProblemReporter extends ProblemReporter {
private final static char[] thisEnclosingJoinPointStaticPartName = "thisEnclosingJoinPointStaticPart".toCharArray();
private final static char[] thisAspectInstanceName = "thisAspectInstance".toCharArray();
public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location) {
@Override
public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location, Scope scope) {
if (CharOperation.equals(binding.name, thisJoinPointName) ||
CharOperation.equals(binding.name, thisJoinPointStaticPartName) ||
CharOperation.equals(binding.name, thisAspectInstanceName) ||
......@@ -526,7 +529,7 @@ public class AjProblemReporter extends ProblemReporter {
return;
}
}
super.uninitializedLocalVariable(binding, location);
super.uninitializedLocalVariable(binding, location, scope);
}
public void abstractMethodInConcreteClass(SourceTypeBinding type) {
......
......@@ -253,7 +253,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
private List<Classpath> processFilePath(List<File> path, java.lang.String encoding) {
List<Classpath> entries = new ArrayList<Classpath>();
for (File file: path) {
entries.add(FileSystem.getClasspath(file.getAbsolutePath(), encoding, null, ClasspathLocation.BINARY));
entries.add(FileSystem.getClasspath(file.getAbsolutePath(), encoding, null, ClasspathLocation.BINARY, null));
}
return entries;
}
......@@ -261,7 +261,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
private List<Classpath> processStringPath(List<String> path, java.lang.String encoding) {
List<Classpath> entries = new ArrayList<Classpath>();
for (String file: path) {
entries.add(FileSystem.getClasspath(file, encoding, null, ClasspathLocation.BINARY));
entries.add(FileSystem.getClasspath(file, encoding, null, ClasspathLocation.BINARY, null));
}
return entries;
}
......
......@@ -954,7 +954,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
// 'classpaths' object it isn't recording where the code came from. This will be an issue later for
// weaving, the distinction will need to be maintained for proper 'module aware/respecting' weaving.
if (buildConfig.getCheckedClasspaths() == null) {
nameEnvironment = new FileSystem(classpaths, filenames, defaultEncoding, ClasspathLocation.BINARY);
nameEnvironment = new FileSystem(classpaths, filenames, defaultEncoding, ClasspathLocation.BINARY, null);
} else {
nameEnvironment = new FileSystem(buildConfig.getCheckedClasspaths(), filenames, false, null);
}
......
......@@ -9,13 +9,10 @@
* Contributors:
* PARC initial implementation
* ******************************************************************/
package org.aspectj.weaver;
import java.lang.reflect.Modifier;
//import org.aspectj.weaver.ResolvedType.Name;
/**
* The AjcMemberMaker is responsible for creating the representations of methods/fields/etc that are placed in both aspects and
* affected target types. It uses the NameMangler class to create the actual names that will be used.
......@@ -69,7 +66,7 @@ public class AjcMemberMaker {
}
public static ResolvedMember perCflowField(UnresolvedType declaringType) {
return new ResolvedMemberImpl(Member.FIELD, declaringType, PUBLIC_STATIC_FINAL, NameMangler.PERCFLOW_FIELD_NAME,
return new ResolvedMemberImpl(Member.FIELD, declaringType, PUBLIC_STATIC, NameMangler.PERCFLOW_FIELD_NAME,
CFLOW_STACK_TYPE.getSignature());
}
......
......@@ -114,18 +114,22 @@ public class MissingResolvedTypeWithKnownSignature extends ResolvedType {
public ISourceContext getSourceContext() {
return new ISourceContext() {
@Override
public ISourceLocation makeSourceLocation(IHasPosition position) {
return null;
}
@Override
public ISourceLocation makeSourceLocation(int line, int offset) {
return null;
}
@Override
public int getOffset() {
return 0;
}
@Override
public void tidy() {
}
......@@ -168,6 +172,7 @@ public class MissingResolvedTypeWithKnownSignature extends ResolvedType {
*
* @see org.aspectj.weaver.AnnotatedElement#hasAnnotation(org.aspectj.weaver.UnresolvedType)
*/
@Override
public boolean hasAnnotation(UnresolvedType ofType) {
raiseCantFindType(WeaverMessages.CANT_FIND_TYPE_ANNOTATION);
return false;
......