Selaa lähdekoodia

Bug 467415 - Weaver created bridge methods missing ACC_SYNTHETIC

tags/V1_8_6
Andy Clement 9 vuotta sitten
vanhempi
commit
066dc11d46

+ 1
- 0
bcel-builder/src/org/aspectj/apache/bcel/Constants.java Näytä tiedosto

public final static short ACC_ABSTRACT = 0x0400; public final static short ACC_ABSTRACT = 0x0400;
public final static short ACC_STRICT = 0x0800; public final static short ACC_STRICT = 0x0800;


public final static short ACC_SYNTHETIC = 0x1000;
public final static short ACC_ANNOTATION = 0x2000; public final static short ACC_ANNOTATION = 0x2000;
public final static short ACC_ENUM = 0x4000; public final static short ACC_ENUM = 0x4000;
public final static short ACC_BRIDGE = 0x0040; public final static short ACC_BRIDGE = 0x0040;

BIN
lib/bcel/bcel-src.zip Näytä tiedosto


BIN
lib/bcel/bcel.jar Näytä tiedosto


+ 1
- 1
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java Näytä tiedosto

} }
// The bridge method in this type will have the same signature as the one in the supertype // The bridge method in this type will have the same signature as the one in the supertype
LazyMethodGen bridgeMethod = makeBridgeMethod(clazz, theBridgeMethod); LazyMethodGen bridgeMethod = makeBridgeMethod(clazz, theBridgeMethod);
int newflags = bridgeMethod.getAccessFlags() | 0x00000040;// BRIDGE = 0x00000040
int newflags = bridgeMethod.getAccessFlags() | Constants.ACC_BRIDGE | Constants.ACC_SYNTHETIC ;// BRIDGE = 0x00000040


if ((newflags & 0x00000100) != 0) { if ((newflags & 0x00000100) != 0) {
newflags = newflags - 0x100;// NATIVE = 0x00000100 - need to clear it newflags = newflags - 0x100;// NATIVE = 0x00000100 - need to clear it

+ 1
- 2
weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java Näytä tiedosto

* We stay away from targeters for rangey things like Shadows and Exceptions. * We stay away from targeters for rangey things like Shadows and Exceptions.
*/ */
public final class LazyMethodGen implements Traceable { public final class LazyMethodGen implements Traceable {
private static final int ACC_SYNTHETIC = 0x1000;


private int modifiers; private int modifiers;
private Type returnType; private Type returnType;


if (isSynthetic) { if (isSynthetic) {
if (enclosingClass.getWorld().isInJava5Mode()) { if (enclosingClass.getWorld().isInJava5Mode()) {
gen.setModifiers(gen.getModifiers() | ACC_SYNTHETIC);
gen.setModifiers(gen.getModifiers() | Constants.ACC_SYNTHETIC);
} }
if (!hasAttribute("Synthetic")) { if (!hasAttribute("Synthetic")) {
// belt and braces, do the attribute even on Java 5 in addition to the modifier flag // belt and braces, do the attribute even on Java 5 in addition to the modifier flag

Loading…
Peruuta
Tallenna