diff options
author | acolyer <acolyer> | 2005-08-04 15:51:50 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2005-08-04 15:51:50 +0000 |
commit | a26f850c10f1790682ff9d1f13a4f8d5253f5e71 (patch) | |
tree | fd8425e75bb084a0a9cd750ed24d0c02a8e1eb25 /weaver | |
parent | 0894d1dd3223cd171b3a1c40e9bc733585cb0c3e (diff) | |
download | aspectj-a26f850c10f1790682ff9d1f13a4f8d5253f5e71.tar.gz aspectj-a26f850c10f1790682ff9d1f13a4f8d5253f5e71.zip |
oops, this is the implementation that is needed for the execution tests I committed to pass...
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/WeaverMessages.java | 3 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java | 38 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/weaver-messages.properties | 4 |
3 files changed, 43 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/WeaverMessages.java b/weaver/src/org/aspectj/weaver/WeaverMessages.java index a186a3691..969ecacf1 100644 --- a/weaver/src/org/aspectj/weaver/WeaverMessages.java +++ b/weaver/src/org/aspectj/weaver/WeaverMessages.java @@ -139,7 +139,8 @@ public class WeaverMessages { public static final String NO_INIT_JPS_FOR_PARAMETERIZED_TYPES = "noInitJPsForParameterizedTypes"; public static final String NO_GENERIC_THROWABLES = "noGenericThrowables"; public static final String WITHINCODE_DOESNT_SUPPORT_PARAMETERIZED_DECLARING_TYPES="noParameterizedDeclaringTypesWithinCode"; - + public static final String EXECUTION_DOESNT_SUPPORT_PARAMETERIZED_DECLARING_TYPES="noParameterizedDeclaringTypesInExecution"; + public static final String CALL_DOESNT_SUPPORT_PARAMETERIZED_DECLARING_TYPES="noParameterizedDeclaringTypesInCall"; public static String format(String key) { return bundle.getString(key); } diff --git a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java index 7bfd08635..199f33085 100644 --- a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java @@ -342,6 +342,44 @@ public class KindedPointcut extends Pointcut { getSourceLocation())); } } + + // no parameterized types in declaring type position + // no throwable parameterized types + if ((kind == Shadow.MethodExecution) || (kind == Shadow.ConstructorExecution)) { + HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor + visitor = new HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor(); + signature.getDeclaringType().traverse(visitor, null); + if (visitor.wellHasItThen/*?*/()) { + scope.message(MessageUtil.error(WeaverMessages.format(WeaverMessages.EXECUTION_DOESNT_SUPPORT_PARAMETERIZED_DECLARING_TYPES), + getSourceLocation())); + } + + visitor = new HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor(); + signature.getThrowsPattern().traverse(visitor, null); + if (visitor.wellHasItThen/*?*/()) { + scope.message(MessageUtil.error(WeaverMessages.format(WeaverMessages.NO_GENERIC_THROWABLES), + getSourceLocation())); + } + } + + // no parameterized types in declaring type position + // no throwable parameterized types + if ((kind == Shadow.MethodCall) || (kind == Shadow.ConstructorCall)) { + HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor + visitor = new HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor(); + signature.getDeclaringType().traverse(visitor, null); + if (visitor.wellHasItThen/*?*/()) { + scope.message(MessageUtil.error(WeaverMessages.format(WeaverMessages.CALL_DOESNT_SUPPORT_PARAMETERIZED_DECLARING_TYPES), + getSourceLocation())); + } + + visitor = new HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor(); + signature.getThrowsPattern().traverse(visitor, null); + if (visitor.wellHasItThen/*?*/()) { + scope.message(MessageUtil.error(WeaverMessages.format(WeaverMessages.NO_GENERIC_THROWABLES), + getSourceLocation())); + } + } } public void resolveBindingsFromRTTI() { diff --git a/weaver/src/org/aspectj/weaver/weaver-messages.properties b/weaver/src/org/aspectj/weaver/weaver-messages.properties index 411780e55..3dc87fcb0 100644 --- a/weaver/src/org/aspectj/weaver/weaver-messages.properties +++ b/weaver/src/org/aspectj/weaver/weaver-messages.properties @@ -149,4 +149,6 @@ noParameterizedTypesInThisAndTarget=parameterized types not supported for this a noParameterizedTypesInGetAndSet=can't use parameterized type patterns for the declaring type of a get or set pointcut expression (use the raw type instead) noInitJPsForParameterizedTypes=no [pre]initialization join points for parameterized types, use raw type instead noGenericThrowables=invalid throws pattern: a generic class may not be a direct or indirect subclass of Throwable -noParameterizedDeclaringTypesWithinCode=can't use parameterized type patterns for the declaring type of a withincode pointcut expression (use the raw type instead)
\ No newline at end of file +noParameterizedDeclaringTypesWithinCode=can't use parameterized type patterns for the declaring type of a withincode pointcut expression (use the raw type instead) +noParameterizedDeclaringTypesInExecution=can't use parameterized type patterns for the declaring type of an execution pointcut expression (use the raw type instead) +noParameterizedDeclaringTypesInCall=can't use parameterized type patterns for the declaring type of a call pointcut expression (use the raw type instead)
\ No newline at end of file |