]> source.dussan.org Git - aspectj.git/commitdiff
Fix for Bugzilla Bug 42668
authorehilsdal <ehilsdal>
Thu, 29 Jan 2004 15:30:42 +0000 (15:30 +0000)
committerehilsdal <ehilsdal>
Thu, 29 Jan 2004 15:30:42 +0000 (15:30 +0000)
effect of an after returning type incompatible with a join point return type

tests/ajcTests.xml
tests/ajcTestsFailing.xml
tests/new/AfterReturningParamMatching.java
weaver/src/org/aspectj/weaver/TypeX.java

index e9ade4e18d7de5657da5ea301213cfed62ed3dc6..57b496aaafa533a26df0c7cda91d1eae9db3f332 100644 (file)
         <compile files="HandlerSig.java"/>
         <run class="HandlerSig"/>
     </ajc-test>
+    
+    <ajc-test dir="new" pr="42668"
+        title="after returning with parameter: matching rules">
+        <compile files="AfterReturningParamMatching.java" />
+        <run class="AfterReturningParamMatching"/>
+    </ajc-test>
 </suite>
index a64b4fb3ca6b2c2f5c5f75c839c51b38b19701f4..cea32f4dd6513ca300ed93ffe6535c8bdda8eb31 100644 (file)
                </compile>
                <run class="org.aspectj.langlib.PointcutsCW"/>
        </ajc-test>
-    
-    <ajc-test dir="new" 
-     pr="42668"
-        title="after returning with parameter: matching rules">
-        <compile files="AfterReturningParamMatching.java" />
-        <run class="AfterReturningParamMatching"/>
-    </ajc-test>
 
     <ajc-test dir="bugs/interAbstract" 
                pr="49784"
index 062bfa541580ddc2ccfc181e859b74ebd9dc95dc..4677eac09b73730df4053426ff146ad08fcc3c06 100644 (file)
@@ -5,16 +5,16 @@ import org.aspectj.testing.Tester;
 public class AfterReturningParamMatching {
        public static void main(String[] args) {
                goBoolean(false);
-               Tester.checkAndClearEvents(new String[] { "Object" });
+               Tester.checkAndClearEvents(new String[] { "boolean", "Object" });
 
                goByte(1);
                Tester.checkAndClearEvents(new String[] { "byte", "int", "long", "Object"});
                
                goInt(2);
-               Tester.checkAndClearEvents(new String[] { "byte", "int", "long", "Object" });
+               Tester.checkAndClearEvents(new String[] { "int", "long", "Object" });
 
                goLong(3);
-               Tester.checkAndClearEvents(new String[] { "byte", "int", "long", "Object" });
+               Tester.checkAndClearEvents(new String[] { "long", "Object" });
                
                goObject(new Object());
                Tester.checkAndClearEvents(new String[] { "Object" });
@@ -62,6 +62,7 @@ aspect A {
                call(* goNumber(*)) || 
                call(* goInteger(*)); 
        
+       after() returning(boolean b): methodsInQuestion() { Tester.event("boolean"); }
        after() returning(byte b): methodsInQuestion() { Tester.event("byte"); }
        after() returning(int b): methodsInQuestion() { Tester.event("int"); }
        after() returning(long b): methodsInQuestion() { Tester.event("long"); }
index c9204cbb19a4b811105a7dee1fc8e71e5a6271d8..b871d721b113fd1136dab4f4e7a43e9ae113eedc 100644 (file)
@@ -372,27 +372,6 @@ public class TypeX {
         return world.isAssignableFrom(this, other);
     }
 
-       /**
-        * Determines if the variables of this type could be assigned values
-        * of another type without conversion.  In other words, if the compiler can't tell whether
-        * such an assignment would be impossible.  This still allows for assignment conversion
-        * for primitive types and casting conversion for reference types.  For reference
-        * types, this is equivalent to isCastableFrom(THIS, OTHER).  For primitive types,
-        * this is equivalent to isAssignableFrom(THIS, OTHER).
-        * 
-        * @param other the other type
-        * @param world the {@link World} in which the possible assignment should be checked.
-        * @return true iff variables of this type could be assigned values of other without casting
-        * @exception NullPointerException if other is null
-        */
-       public final boolean couldBeAssignableFrom(TypeX other, World world) {
-               // primitives override this method, so we know we're not primitive.
-               // So if the other is primitive, don't bother asking the world anything.
-               if (other.isPrimitive()) return false;
-               return world.isCoerceableFrom(this, other);
-       }
-
-
     /**
      * Determines if values of another type could possibly be cast to
      * this type.  The rules followed are from JLS 2ed 5.5, "Casting Conversion".