// first pass, look for version
List<Unknown> forSecondPass = new ArrayList<Unknown>();
for (int i = as.length - 1; i >= 0; i--) {
Attribute a = as[i];
if (a instanceof Unknown) {
Unknown u = (Unknown) a;
String name = u.getName();
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,
dataDecompressor);
if (version.getMajorVersion() > WeaverVersionInfo.getCurrentWeaverMajorVersion()) {
throw new BCException(
"Unable to continue, this version of AspectJ supports classes built with weaver version "
+ WeaverVersionInfo.toCurrentVersionString() + " but the class " + classname
+ " is version " + version.toString() + ". Please update your AspectJ.");
}
}
forSecondPass.add(u);
}
}
}
}
// FIXASC why going backwards? is it important
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, dataDecompressor);
if (attr != null) {
attributes.add(attr);
}
}
return attributes;