]> source.dussan.org Git - aspectj.git/commitdiff
oops, this is the implementation that is needed for the execution tests I committed...
authoracolyer <acolyer>
Thu, 4 Aug 2005 15:51:50 +0000 (15:51 +0000)
committeracolyer <acolyer>
Thu, 4 Aug 2005 15:51:50 +0000 (15:51 +0000)
weaver/src/org/aspectj/weaver/WeaverMessages.java
weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java
weaver/src/org/aspectj/weaver/weaver-messages.properties

index a186a36912047b7fc514be90e81262621cb9248f..969ecacf130573ee1792e38654bd05b1dfe4f42a 100644 (file)
@@ -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);
        }
index 7bfd0863539f434ded8102526dabcfdd7e3b436e..199f33085f286b3da6b794f9298dca1928dbaa6f 100644 (file)
@@ -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() {
index 411780e559d728b55b2221c0498d6d1edb057982..3dc87fcb08980cc2b2dce6e78716312bd8ba3146 100644 (file)
@@ -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