diff options
author | acolyer <acolyer> | 2005-09-22 15:45:06 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-09-22 15:45:06 +0000 |
commit | 8a0f59ad18ace56ff59cd9108d18c70358a4f055 (patch) | |
tree | 45ca73c9880d6010a1676dd069c8166f161c845a /weaver | |
parent | 0442d2f26935d7da1a6819eb79c5e7a1c034b229 (diff) | |
download | aspectj-8a0f59ad18ace56ff59cd9108d18c70358a4f055.tar.gz aspectj-8a0f59ad18ace56ff59cd9108d18c70358a4f055.zip |
tests and fix for 109283.
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/AjcMemberMaker.java | 44 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java | 4 |
2 files changed, 38 insertions, 10 deletions
diff --git a/weaver/src/org/aspectj/weaver/AjcMemberMaker.java b/weaver/src/org/aspectj/weaver/AjcMemberMaker.java index c5c3024cc..142c055fa 100644 --- a/weaver/src/org/aspectj/weaver/AjcMemberMaker.java +++ b/weaver/src/org/aspectj/weaver/AjcMemberMaker.java @@ -270,17 +270,45 @@ public class AjcMemberMaker { }; // PTWIMPL ResolvedMember for aspectOf(), declared in aspect - public static ResolvedMember perTypeWithinAspectOfMethod(UnresolvedType declaringType) { - return new ResolvedMemberImpl(Member.METHOD, - declaringType, PUBLIC_STATIC, "aspectOf", - "(Ljava/lang/Class;)" + declaringType.getSignature()); + public static ResolvedMember perTypeWithinAspectOfMethod(UnresolvedType declaringType,boolean inJava5Mode) { + UnresolvedType parameterType = null; + if (inJava5Mode) { + parameterType = UnresolvedType.forRawTypeName("java.lang.Class"); + } else { + parameterType = UnresolvedType.forSignature("Ljava/lang/Class;"); + } + return new ResolvedMemberImpl( + Member.METHOD, + declaringType, + PUBLIC_STATIC, + declaringType, + "aspectOf", + new UnresolvedType[] {parameterType} + ); +// return new ResolvedMemberImpl(Member.METHOD, +// declaringType, PUBLIC_STATIC, "aspectOf", +// "(Ljava/lang/Class;)" + declaringType.getSignature()); } // PTWIMPL ResolvedMember for hasAspect(), declared in aspect - public static ResolvedMember perTypeWithinHasAspectMethod(UnresolvedType declaringType) { - return new ResolvedMemberImpl(Member.METHOD, - declaringType, PUBLIC_STATIC, "hasAspect", - "(Ljava/lang/Class;)Z"); + public static ResolvedMember perTypeWithinHasAspectMethod(UnresolvedType declaringType, boolean inJava5Mode) { + UnresolvedType parameterType = null; + if (inJava5Mode) { + parameterType = UnresolvedType.forRawTypeName("java.lang.Class"); + } else { + parameterType = UnresolvedType.forSignature("Ljava/lang/Class;"); + } + return new ResolvedMemberImpl( + Member.METHOD, + declaringType, + PUBLIC_STATIC, + ResolvedType.BOOLEAN, + "hasAspect", + new UnresolvedType[] {parameterType} + ); +// return new ResolvedMemberImpl(Member.METHOD, +// declaringType, PUBLIC_STATIC, "hasAspect", +// "(Ljava/lang/Class;)Z"); }; // -- privileged accessors diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java b/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java index 724c06816..242e8b76d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelPerClauseAspectAdder.java @@ -398,7 +398,7 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger { private void generatePerTWAspectOfMethod(LazyClassGen classGen) { InstructionFactory factory = classGen.getFactory(); - LazyMethodGen method = makeMethodGen(classGen, AjcMemberMaker.perTypeWithinAspectOfMethod(aspectType)); + LazyMethodGen method = makeMethodGen(classGen, AjcMemberMaker.perTypeWithinAspectOfMethod(aspectType,classGen.getWorld().isInJava5Mode())); flagAsSynthetic(method, false); classGen.addMethodGen(method); @@ -437,7 +437,7 @@ public class BcelPerClauseAspectAdder extends BcelTypeMunger { private void generatePerTWHasAspectMethod(LazyClassGen classGen) { InstructionFactory factory = classGen.getFactory(); - LazyMethodGen method = makeMethodGen(classGen, AjcMemberMaker.perTypeWithinHasAspectMethod(aspectType)); + LazyMethodGen method = makeMethodGen(classGen, AjcMemberMaker.perTypeWithinHasAspectMethod(aspectType,classGen.getWorld().isInJava5Mode())); flagAsSynthetic(method, false); classGen.addMethodGen(method); |