From 2f2f5683643a0f1e0856ac43fa590c4b39f1be26 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 28 Jun 2006 11:44:10 +0000 Subject: [PATCH] bit of reordering to Ajc152Tests - and fixed 148972 --- .../org/aspectj/systemtest/ajc152/Ajc152Tests.java | 14 +++++++++----- .../org/aspectj/weaver/bcel/BcelTypeMunger.java | 9 ++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index c60ba90b4..87f10c52b 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -29,15 +29,24 @@ import org.aspectj.weaver.World; 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");} @@ -69,12 +78,8 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { 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");} @@ -99,7 +104,6 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { 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");} diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java index cee9a43f0..ace4bb570 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java @@ -200,9 +200,11 @@ public class BcelTypeMunger extends ConcreteTypeMunger { 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; + } } } } @@ -331,6 +333,8 @@ public class BcelTypeMunger extends ConcreteTypeMunger { 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()); @@ -340,6 +344,9 @@ public class BcelTypeMunger extends ConcreteTypeMunger { 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; } } -- 2.39.5