]> source.dussan.org Git - aspectj.git/commitdiff
test and fix for 147701: @DeclareParents: was failing to include package name for...
authoraclement <aclement>
Tue, 20 Jun 2006 07:51:45 +0000 (07:51 +0000)
committeraclement <aclement>
Tue, 20 Jun 2006 07:51:45 +0000 (07:51 +0000)
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
tests/src/org/aspectj/systemtest/ajc152/ajc152.xml
weaver/src/org/aspectj/weaver/bcel/AtAjAttributes.java
weaver/src/org/aspectj/weaver/bcel/BcelTypeMunger.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java

index c33abb8ab740ff66e2bd20d53d081d4d19a26427..6871867d83082d8cbd8ef5900518583d3dea3be1 100644 (file)
@@ -32,6 +32,9 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
 //  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 testPackageIgnoredForException_pr147701_1() { runTest("package for exception ignored");}
+  public void testPackageIgnoredForException_pr147701_2() { runTest("package for exception ignored - 2");}
+  public void testPackageIgnoredForException_pr147701_3() { runTest("package for exception ignored - 3");}
   public void testBrokenAddSerialVersionUID_pr145950() {runTest("fails to discover Serializable");}
   public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_1() {runTest("no unnecessary declaration of thrown exception warning - 1");}
   public void testNoUnnecessaryDeclarationOfThrownExcp_pr129282_2() {runTest("no unnecessary declaration of thrown exception warning - 2");}
index 77e80c7943841baba718d4e443b93ebf1ed9f97e..1525089a0a428350198230c12cef56305057fede 100644 (file)
     <ajc-test dir="bugs152" title="new IProgramElement handle methods">
       <compile files="pr141730.aj" options="-emacssym -1.5"/>
     </ajc-test>
+    
+    <ajc-test dir="bugs152/pr147701" title="package for exception ignored">
+      <compile files="TestBean.java" options="-1.5"/>
+      <run class="a.b.c.TestBean"/>
+    </ajc-test>
+    
+    <ajc-test dir="bugs152/pr147701" title="package for exception ignored - 2">
+      <compile files="TestBean2.java" options="-1.5"/>
+      <run class="a.b.c.TestBean2"/>
+    </ajc-test>
+    
+    <ajc-test dir="bugs152/pr147701" title="package for exception ignored - 3">
+      <compile files="TestBean3.java" options="-1.5">
+        <message kind="error" text="@DeclareParents: defaultImpl=&quot;a.b.c.Impl&quot; does not implement the interface 'a.b.c.I'"/>
+      </compile>
+    </ajc-test>
 
     <ajc-test dir="bugs152" title="declare @method relationship">
      <compile files="pr143924.aj" options="-1.5 -showWeaveInfo -emacssym">
index ed676fde9e5c5dc705f7289fc6b6e48d60273ed5..4e28a619ec5a4fc9d0538037b1d95028633380be 100644 (file)
@@ -734,6 +734,9 @@ public class AtAjAttributes {
                                             + defaultImplClassName
                                             + "\" has no public no-arg constructor", struct);
                             }
+                            if (!fieldType.isAssignableFrom(impl)) {
+                               reportError("@DeclareParents: defaultImpl=\""+defaultImplClassName+"\" does not implement the interface '"+fieldType.toString()+"'",struct);
+                            }
                         }
 
                     }
index c7cc01c790cbf4e01c640b2473631f1c51d1c844..cee9a43f08a375fdae26ecb9c3f1e35a559bb084 100644 (file)
@@ -1168,7 +1168,6 @@ public class BcelTypeMunger extends ConcreteTypeMunger {
             );
 
             mg.getBody().append(body);
-            // XXX make sure to check that we set exceptions properly on this guy.
             weaver.addLazyMethodGen(mg);
             weaver.getLazyClassGen().warnOnAddedMethod(mg.getMethod(),getSignature().getSourceLocation());
             return true;
index e75f79a276866f4dd837c60cb3def3043623848e..c06f963c0c64f36baf73ebcee9363bd81f0ad3f8 100644 (file)
@@ -227,7 +227,7 @@ public class BcelWorld extends World implements Repository {
     static String[] makeBcelTypesAsClassNames(UnresolvedType[] types) {
         String[] ret = new String[types.length];
         for (int i = 0, len = types.length; i < len; i++) {
-            ret[i] = types[i].getClassName();//makeBcelType(types[i]);
+            ret[i] = types[i].getName();
         }
         return ret;
     }