From: aclement Date: Thu, 19 Nov 2009 17:32:04 +0000 (+0000) Subject: avoid using helpers on Member hierarchy X-Git-Tag: V1_6_7~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4b627b68d078ca1ac24bdf9bb6fd0913b8068f2b;p=aspectj.git avoid using helpers on Member hierarchy --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index 1f841ed37..d5fa8c882 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -414,12 +414,13 @@ public class BcelTypeMunger extends ConcreteTypeMunger { */ private boolean enforceDecpRule5_cantChangeFromStaticToNonstatic(BcelClassWeaver weaver, ISourceLocation mungerLoc, ResolvedMember superMethod, LazyMethodGen subMethod) { - if (superMethod.isStatic() && !subMethod.isStatic()) { + boolean superMethodStatic = Modifier.isStatic(superMethod.getModifiers()); + if (superMethodStatic && !subMethod.isStatic()) { error(weaver, "This instance method " + subMethod.getName() + subMethod.getParameterSignature() + " cannot override the static method from " + superMethod.getDeclaringType().getName(), subMethod .getSourceLocation(), new ISourceLocation[] { mungerLoc }); return false; - } else if (!superMethod.isStatic() && subMethod.isStatic()) { + } else if (!superMethodStatic && subMethod.isStatic()) { error(weaver, "The static method " + subMethod.getName() + subMethod.getParameterSignature() + " cannot hide the instance method from " + superMethod.getDeclaringType().getName(), subMethod .getSourceLocation(), new ISourceLocation[] { mungerLoc }); @@ -963,7 +964,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { InstructionFactory fact = classGen.getFactory(); int pos = 0; - if (!mangledInterMethod.isStatic()) { + if (!Modifier.isStatic(mangledInterMethod.getModifiers())) { body.append(InstructionFactory.createThis()); pos++; } @@ -1375,7 +1376,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { // args int pos = 0; - if (!introduced.isStatic()) { // skip 'this' (?? can this really + if (!Modifier.isStatic(introduced.getModifiers())) { // skip 'this' (?? can this really // happen) // body.append(InstructionFactory.createThis()); pos++; @@ -1852,7 +1853,7 @@ public class BcelTypeMunger extends ConcreteTypeMunger { ResolvedMember itdfieldSetter = AjcMemberMaker.interFieldInterfaceSetter(field, gen.getType(), aspectType); LazyMethodGen mg1 = makeMethodGen(gen, itdfieldSetter); InstructionList il1 = new InstructionList(); - if (field.isStatic()) { + if (Modifier.isStatic(field.getModifiers())) { il1.append(InstructionFactory.createLoad(fieldType, 0)); il1.append(fact.createFieldAccess(gen.getClassName(), fg.getName(), fieldType, Constants.PUTSTATIC)); } else {