]> source.dussan.org Git - aspectj.git/commitdiff
fix for Bug 60936
authoraclement <aclement>
Wed, 12 May 2004 12:51:13 +0000 (12:51 +0000)
committeraclement <aclement>
Wed, 12 May 2004 12:51:13 +0000 (12:51 +0000)
   error message for constructor-execution pcd

weaver/src/org/aspectj/weaver/Lint.java
weaver/src/org/aspectj/weaver/XlintDefault.properties
weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java

index b1be8a2763d6a7da60b4d2455df3986a30af109b..6861d611cf9e05c5465d60cfe37b04ba0d9815a1 100644 (file)
@@ -58,6 +58,9 @@ public class Lint {
 
        public final Kind serialVersionUIDBroken = 
                new Kind("brokeSerialVersionCompatibility", "serialVersionUID of type {0} is broken because of added field {1}");
+               
+       public final Kind noInterfaceCtorJoinpoint = 
+               new Kind("noInterfaceCtorJoinpoint","no interface constructor-execution join point - use {0}+ for implementing classes");
             
        public Lint(World world) {
                this.world = world;
index 91ce5d469b80b877503431d12b03c16de7206885..3b584d93f229da85a2a004cd1c3ba63f849a593e 100644 (file)
@@ -12,4 +12,6 @@ unmatchedSuperTypeInCall = warning
 canNotImplementLazyTjp = warning
 
 needsSerialVersionUIDField = ignore
-brokeSerialVersionCompatibility = ignore
\ No newline at end of file
+brokeSerialVersionCompatibility = ignore
+
+noInterfaceCtorJoinpoint = warning
\ No newline at end of file
index 43e53724b92300d11da6c2562ea1027ff74c9d0c..202c4ead75cdafc517ab8167865f44e7a482f67c 100644 (file)
@@ -22,6 +22,7 @@ import org.aspectj.util.FuzzyBoolean;
 import org.aspectj.weaver.Checker;
 import org.aspectj.weaver.ISourceContext;
 import org.aspectj.weaver.IntMap;
+import org.aspectj.weaver.Member;
 import org.aspectj.weaver.ResolvedTypeX;
 import org.aspectj.weaver.Shadow;
 import org.aspectj.weaver.ShadowMunger;
@@ -180,6 +181,20 @@ public class KindedPointcut extends Pointcut {
 //                                     this.getSourceLocation()));
                }
                signature = signature.resolveBindings(scope, bindings);
+               
+               
+               if (kind == Shadow.ConstructorExecution) {              // Bug fix 60936
+                 if (signature.getDeclaringType() != null) {
+                       World world = scope.getWorld();
+                       TypeX exactType = signature.getDeclaringType().getExactType();
+                       if (signature.getKind() == Member.CONSTRUCTOR &&
+                               !exactType.equals(ResolvedTypeX.MISSING) &&
+                               exactType.isInterface(world) &&
+                               !signature.getDeclaringType().isIncludeSubtypes()) {
+                                       world.getLint().noInterfaceCtorJoinpoint.signal(exactType.toString(), getSourceLocation());
+                               }
+                 }
+               }
        }
        public Test findResidue(Shadow shadow, ExposedState state) {
                return match(shadow).alwaysTrue() ? Literal.TRUE : Literal.FALSE;