소스 검색

Fix for pr92880: I've removed the exception clause from the declaration of ajc$getInstance() and modified the internals to return null if an exception occurs rather than rethrowing it. I've only changed the code gen in the compiler layer, not in the weaver layer. (interestingly with only my compiler layer change, no tests fail...)

tags/V1_5_0M3
aclement 19 년 전
부모
커밋
d2ab7c219d

+ 3
- 3
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java 파일 보기

@@ -749,9 +749,9 @@ public class AspectDeclaration extends TypeDeclaration {
exc.placeEnd();
codeStream.areturn();
exc.place();
codeStream.astore_1();
codeStream.aload_1();
codeStream.athrow();
// this just returns null now - the old version used to throw the caught exception!
codeStream.aconst_null();
codeStream.areturn();
}});
}

+ 2
- 3
weaver/src/org/aspectj/weaver/AjcMemberMaker.java 파일 보기

@@ -178,15 +178,14 @@ public class AjcMemberMaker {
// PTWIMPL ResolvedMember for getInstance() method, declared in aspect
public static ResolvedMember perTypeWithinGetInstance(UnresolvedType declaringType) {
// private static a.X ajc$getInstance(java.lang.Class) throws java/lang/Exception
// private static a.X ajc$getInstance(java.lang.Class)
ResolvedMemberImpl rm = new ResolvedMemberImpl(
Member.METHOD,
declaringType,
PRIVATE_STATIC,
declaringType, // return value
NameMangler.PERTYPEWITHIN_GETINSTANCE_METHOD,
new UnresolvedType[]{UnresolvedType.JAVA_LANG_CLASS},
new UnresolvedType[]{UnresolvedType.JAVA_LANG_EXCEPTION}
new UnresolvedType[]{UnresolvedType.JAVA_LANG_CLASS}
);
return rm;
}

Loading…
취소
저장