aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2004-05-12 12:51:13 +0000
committeraclement <aclement>2004-05-12 12:51:13 +0000
commit4b65e3caf070cb578b8db8fae331e990d9dfee27 (patch)
treec3cd5bc23d59b81bfcf3d9edbd2a875861a9f52d /weaver
parent54c2294c5f4d50aed42049ec8db0f128293d30a1 (diff)
downloadaspectj-4b65e3caf070cb578b8db8fae331e990d9dfee27.tar.gz
aspectj-4b65e3caf070cb578b8db8fae331e990d9dfee27.zip
fix for Bug 60936
error message for constructor-execution pcd
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/Lint.java3
-rw-r--r--weaver/src/org/aspectj/weaver/XlintDefault.properties4
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java15
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;