if (attrs != null && attrs.length > 0) {
ISourceContext sourceContext = getSourceContext(world);
List<AjAttribute> as = Utility.readAjAttributes(getDeclaringType().getClassName(), attrs, sourceContext, world,
- (bcelObjectType != null ? bcelObjectType.getWeaverVersionAttribute() : WeaverVersionInfo.CURRENT));
+ (bcelObjectType != null ? bcelObjectType.getWeaverVersionAttribute() : WeaverVersionInfo.CURRENT),
+ new BcelConstantPoolReader(field.getConstantPool()));
as.addAll(AtAjAttributes.readAj5FieldAttributes(field, this, world.resolve(getDeclaringType()), sourceContext, world
.getMessageHandler()));
associatedShadowMunger = null;
ResolvedType resolvedDeclaringType = getDeclaringType().resolve(world);
List<AjAttribute> as = Utility.readAjAttributes(resolvedDeclaringType.getClassName(), method.getAttributes(),
- resolvedDeclaringType.getSourceContext(), world, bcelObjectType.getWeaverVersionAttribute());
+ resolvedDeclaringType.getSourceContext(), world, bcelObjectType.getWeaverVersionAttribute(),
+ new BcelConstantPoolReader(method.getConstantPool()));
processAttributes(world, as);
as = AtAjAttributes.readAj5MethodAttributes(method, this, resolvedDeclaringType, preResolvedPointcut, resolvedDeclaringType
.getSourceContext(), world.getMessageHandler());
List<AjAttribute> l = null;
try {
l = Utility.readAjAttributes(className, javaClass.getAttributes(), getResolvedTypeX().getSourceContext(),
- getResolvedTypeX().getWorld(), AjAttribute.WeaverVersionInfo.UNKNOWN);
+ getResolvedTypeX().getWorld(), AjAttribute.WeaverVersionInfo.UNKNOWN, new BcelConstantPoolReader(
+ javaClass.getConstantPool()));
} catch (RuntimeException re) {
throw new RuntimeException("Problem processing attributes in " + javaClass.getFileName(), re);
}
if (enclosingClass != null && enclosingClass.getType() != null) {
context = enclosingClass.getType().getSourceContext();
}
- List as = Utility.readAjAttributes(getClassName(), attributes.toArray(new Attribute[] {}), context, null, weaverVersion);
+ List as = Utility.readAjAttributes(getClassName(), attributes.toArray(new Attribute[] {}), context, null, weaverVersion,
+ new BcelConstantPoolReader(this.enclosingClass.getConstantPool()));
if (!as.isEmpty()) {
out.println(" " + as.get(0)); // XXX assuming exactly one
// attribute, munger...
import org.aspectj.weaver.AjAttribute;
import org.aspectj.weaver.AnnotationAJ;
import org.aspectj.weaver.BCException;
+import org.aspectj.weaver.ConstantPoolReader;
import org.aspectj.weaver.ISourceContext;
import org.aspectj.weaver.Lint;
import org.aspectj.weaver.Member;
public class Utility {
public static List<AjAttribute> readAjAttributes(String classname, Attribute[] as, ISourceContext context, World w,
- AjAttribute.WeaverVersionInfo version) {
+ AjAttribute.WeaverVersionInfo version, ConstantPoolReader dataDecompressor) {
List<AjAttribute> l = new ArrayList<AjAttribute>();
// first pass, look for version
if (name.charAt(0) == 'o') { // 'o'rg.aspectj
if (name.startsWith(AjAttribute.AttributePrefix)) {
if (name.endsWith(WeaverVersionInfo.AttributeName)) {
- version = (AjAttribute.WeaverVersionInfo) AjAttribute.read(version, name, u.getBytes(), context, w);
+ version = (AjAttribute.WeaverVersionInfo) AjAttribute.read(version, name, u.getBytes(), context, w,
+ dataDecompressor);
if (version.getMajorVersion() > WeaverVersionInfo.getCurrentWeaverMajorVersion()) {
throw new BCException(
"Unable to continue, this version of AspectJ supports classes built with weaver version "
for (int i = forSecondPass.size() - 1; i >= 0; i--) {
Unknown a = forSecondPass.get(i);
String name = a.getName();
- AjAttribute attr = AjAttribute.read(version, name, a.getBytes(), context, w);
+ AjAttribute attr = AjAttribute.read(version, name, a.getBytes(), context, w, dataDecompressor);
if (attr != null) {
l.add(attr);
}
public static Attribute bcelAttribute(AjAttribute a, ConstantPool pool) {
int nameIndex = pool.addUtf8(a.getNameString());
- byte[] bytes = a.getBytes();
+ byte[] bytes = a.getBytes(new BcelConstantPoolWriter(pool));
int length = bytes.length;
return new Unknown(nameIndex, length, bytes, pool);