浏览代码

388971 - fix for double synthetic attributes

tags/V1_7_1
Andy Clement 11 年前
父节点
当前提交
c2ff74fd56
共有 1 个文件被更改,包括 15 次插入5 次删除
  1. 15
    5
      weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java

+ 15
- 5
weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java 查看文件

@@ -967,11 +967,12 @@ public final class LazyMethodGen implements Traceable {
if (enclosingClass.getWorld().isInJava5Mode()) {
gen.setModifiers(gen.getModifiers() | ACC_SYNTHETIC);
}
// belt and braces, do the attribute even on Java 5 in addition to
// the modifier flag
ConstantPool cpg = gen.getConstantPool();
int index = cpg.addUtf8("Synthetic");
gen.addAttribute(new Synthetic(index, 0, new byte[0], cpg));
if (!hasAttribute("Synthetic")) {
// belt and braces, do the attribute even on Java 5 in addition to the modifier flag
ConstantPool cpg = gen.getConstantPool();
int index = cpg.addUtf8("Synthetic");
gen.addAttribute(new Synthetic(index, 0, new byte[0], cpg));
}
}

if (hasBody()) {
@@ -991,6 +992,15 @@ public final class LazyMethodGen implements Traceable {
}
return gen;
}
private boolean hasAttribute(String attributeName) {
for (Attribute attr: attributes) {
if (attr.getName().equals(attributeName)) {
return true;
}
}
return false;
}

private void forceSyntheticForAjcMagicMembers() {
if (NameMangler.isSyntheticMethod(getName(), inAspect())) {

正在加载...
取消
保存