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;
canNotImplementLazyTjp = warning
needsSerialVersionUIDField = ignore
-brokeSerialVersionCompatibility = ignore
\ No newline at end of file
+brokeSerialVersionCompatibility = ignore
+
+noInterfaceCtorJoinpoint = warning
\ No newline at end of file
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;
// 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;