From: aclement Date: Wed, 12 May 2004 12:51:13 +0000 (+0000) Subject: fix for Bug 60936 X-Git-Tag: V1_2_0~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4b65e3caf070cb578b8db8fae331e990d9dfee27;p=aspectj.git fix for Bug 60936 error message for constructor-execution pcd --- 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;