diff options
author | ehilsdal <ehilsdal> | 2004-01-29 15:30:42 +0000 |
---|---|---|
committer | ehilsdal <ehilsdal> | 2004-01-29 15:30:42 +0000 |
commit | 520ad8a1aa6073e38f99c90c35b085cba96c76ae (patch) | |
tree | 65b18bdcdfd5b175df7ba468cea15efc0d2c9f34 | |
parent | 7cd8809a34dd3264b9c65b58d508c75cf534dfde (diff) | |
download | aspectj-520ad8a1aa6073e38f99c90c35b085cba96c76ae.tar.gz aspectj-520ad8a1aa6073e38f99c90c35b085cba96c76ae.zip |
Fix for Bugzilla Bug 42668
effect of an after returning type incompatible with a join point return type
-rw-r--r-- | tests/ajcTests.xml | 6 | ||||
-rw-r--r-- | tests/ajcTestsFailing.xml | 7 | ||||
-rw-r--r-- | tests/new/AfterReturningParamMatching.java | 7 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/TypeX.java | 21 |
4 files changed, 10 insertions, 31 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index e9ade4e18..57b496aaa 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -7141,4 +7141,10 @@ <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> diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index a64b4fb3c..cea32f4dd 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -119,13 +119,6 @@ </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" diff --git a/tests/new/AfterReturningParamMatching.java b/tests/new/AfterReturningParamMatching.java index 062bfa541..4677eac09 100644 --- a/tests/new/AfterReturningParamMatching.java +++ b/tests/new/AfterReturningParamMatching.java @@ -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"); } diff --git a/weaver/src/org/aspectj/weaver/TypeX.java b/weaver/src/org/aspectj/weaver/TypeX.java index c9204cbb1..b871d721b 100644 --- a/weaver/src/org/aspectj/weaver/TypeX.java +++ b/weaver/src/org/aspectj/weaver/TypeX.java @@ -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". |