diff options
-rw-r--r-- | weaver/src/org/aspectj/weaver/Lint.java | 3 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/XlintDefault.properties | 4 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java | 15 |
3 files changed, 21 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/Lint.java b/weaver/src/org/aspectj/weaver/Lint.java index b1be8a276..6861d611c 100644 --- a/weaver/src/org/aspectj/weaver/Lint.java +++ b/weaver/src/org/aspectj/weaver/Lint.java @@ -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; diff --git a/weaver/src/org/aspectj/weaver/XlintDefault.properties b/weaver/src/org/aspectj/weaver/XlintDefault.properties index 91ce5d469..3b584d93f 100644 --- a/weaver/src/org/aspectj/weaver/XlintDefault.properties +++ b/weaver/src/org/aspectj/weaver/XlintDefault.properties @@ -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 diff --git a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java index 43e53724b..202c4ead7 100644 --- a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java @@ -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; |