public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+// public void testCovarianceAndDecp_pr128443_1() { runTest("covariance and decp - 1"); }
+// public void testSuperITDExplosion_pr134425() { runTest("super ITDs");}
+// public void testMisbehavingDeclareAnnotation_pr135865() { runTest("misbehaving declare annotation");}
+// public void testMisbehavingDeclareAnnotation_pr135865_2() { runTest("misbehaving declare annotation - 2");}
// public void testverifyErrNoTypeCflowField_pr145693() {runTest("verifyErrNoTypeCflowField");}
// public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");}
// public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");}
// public void testItdCallingGenericMethod_pr145391_2() { runTest("itd calling generic method - 2");}
// public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");}
// public void testClassCastForInvalidAnnotationValue_pr148537() { runTest("classcast annotation value");}
+
+
+ // tests added post 152rc1 and before final
public void testSeparateCallAspectOf_pr148727() { runTest("separate compilation calling aspectOf and hasAspect"); }
public void testIntegratedCallAspectOf_pr148727() { runTest("integrated compilation calling aspectOf and hasAspect"); }
public void testFreakyNewArrayJoinpoint_pr148786() { runTest("freaky new array joinpoint"); }
+
+ // tests adding during 152 development
public void testPrivilegeGeneric_pr148545() { runTest("nosuchmethoderror for privileged aspect");}
public void testPrivilegeGeneric_pr148545_2() { runTest("nosuchmethoderror for privileged aspect - 2");}
public void testUnknownAnnotationNPE() { runTest("NPE for unknown annotation");}
public void testItdOnInnerTypeOfGenericType_pr132349() { runTest("ITD on inner type of generic type");}
public void testItdOnInnerTypeOfGenericType_pr132349_2() { runTest("ITD on inner type of generic type - 2");}
public void testItdOnInnerTypeOfGenericType_pr132349_3() { runTest("ITD on inner type of generic type - 3");}
-// public void testCovarianceAndDecp_pr128443_1() { runTest("covariance and decp - 1"); }
public void testLTWGeneratedAspectAbstractMethod_pr125480() { runTest("aop.xml aspect inheriting abstract method ");}
public void testLTWGeneratedAspectAbstractMethod_pr125480_2() { runTest("aop.xml aspect inheriting abstract method - code style");}
- //public void testSuperITDExplosion_pr134425() { runTest("super ITDs");}
- //public void testMisbehavingDeclareAnnotation_pr135865() { runTest("misbehaving declare annotation");}
- //public void testMisbehavingDeclareAnnotation_pr135865_2() { runTest("misbehaving declare annotation - 2");}
public void testCompletelyBrokenAopConcretization_pr142165_1() { runTest("broken concretization");}
public void testCompletelyBrokenAopConcretization_pr142165_2() { runTest("broken concretization - 2");}
public void testCompletelyBrokenAopConcretization_pr142165_3() { runTest("broken concretization - 3");}
public void testAspectLibrariesAndASM_pr135001() { runTest("aspect libraries and asm");}
public void testStackOverflow_pr136258() { runTest("stack overflow");}
public void testIncorrectOverridesEvaluation13() { runTest("incorrect overrides evaluation - 1.3"); }
-// public void testIncorrectOverridesEvaluation14() { runTest("incorrect overrides evaluation - 1.4"); }
public void testIncorrectOverridesEvaluation15() { runTest("incorrect overrides evaluation - 1.5"); }
public void testAtWithinCodeBug_pr138798() { runTest("atWithinCodeBug"); }
public void testReferencePCutInDeclareWarning_pr138215() { runTest("Reference pointcut fails inside @DeclareWarning");}
LazyMethodGen subMethod = findMatchingMethod(newParentTarget, superMethod);
if (subMethod!=null && !subMethod.isBridgeMethod()) { // FIXME asc is this safe for all bridge methods?
if (!(subMethod.isSynthetic() && superMethod.isSynthetic())) {
- cont = enforceDecpRule3_visibilityChanges(weaver, newParent, superMethod, subMethod) && cont;
+ if (!(subMethod.isStatic() && subMethod.getName().startsWith("access$"))) { // ignore generated accessors
+ cont = enforceDecpRule3_visibilityChanges(weaver, newParent, superMethod, subMethod) && cont;
cont = enforceDecpRule4_compatibleReturnTypes(weaver, superMethod, subMethod) && cont;
cont = enforceDecpRule5_cantChangeFromStaticToNonstatic(weaver,munger.getSourceLocation(),superMethod,subMethod) && cont;
+ }
}
}
}
boolean cont = true;
String superReturnTypeSig = superMethod.getReturnType().getSignature();
String subReturnTypeSig = subMethod.getReturnType().getSignature();
+ superReturnTypeSig = superReturnTypeSig.replace('.','/');
+ subReturnTypeSig = subReturnTypeSig.replace('.','/');
if (!superReturnTypeSig.equals(subReturnTypeSig)) {
// Allow for covariance - wish I could test this (need Java5...)
ResolvedType subType = weaver.getWorld().resolve(subMethod.getReturnType());
weaver.getWorld().getMessageHandler().handleMessage(MessageUtil.error(
"The return type is incompatible with "+superMethod.getDeclaringType()+"."+superMethod.getName()+superMethod.getParameterSignature(),
subMethod.getSourceLocation()));
+// this just might be a better error message...
+// "The return type '"+subReturnTypeSig+"' is incompatible with the overridden method "+superMethod.getDeclaringType()+"."+
+// superMethod.getName()+superMethod.getParameterSignature()+" which returns '"+superReturnTypeSig+"'",
cont=false;
}
}