return Modifier.isAbstract(modifiers);
}
+ public boolean isVisible(ResolvedTypeX fromType) {
+ World world = fromType.getWorld();
+ return ResolvedTypeX.isVisible(getModifiers(), getDeclaringType().resolve(world),
+ fromType);
+ }
}
} else {
if (this instanceof BcelObjectType) return false; //XXX ignores separate comp
getWorld().getMessageHandler().handleMessage(
- MessageUtil.error("inter-type declaration from " + munger.getAspectType() +
+ MessageUtil.error("inter-type declaration from " + munger.getAspectType().getName() +
" conflicts with existing member: " + existingMember,
munger.getSourceLocation())
);
//System.err.println("conflict at " + m2.getSourceLocation());
getWorld().getMessageHandler().handleMessage(MessageUtil.error(
"intertype declaration from "
- + m1.getAspectType().getClassName()
+ + m1.getAspectType().getName()
+ " conflicts with intertype declaration: "
+ m2.getSignature()
+ " from "
- + m2.getAspectType().getClassName(),
+ + m2.getAspectType().getName(),
m2.getSourceLocation()));
}
return;
}
+ // check visibility
+ if (!pointcutDef.isVisible(scope.getEnclosingType())) {
+ scope.message(IMessage.ERROR, this, "pointcut declaration " + pointcutDef + " is not accessible");
+ return;
+ }
+
if (Modifier.isAbstract(pointcutDef.getModifiers())) {
if (onType != null) {
scope.message(IMessage.ERROR, this,
"bad parameter to pointcut reference");
return;
}
- if (!p.matchesSubtypes(parameterTypes[i])) {
+ if (!p.matchesSubtypes(parameterTypes[i]) &&
+ !p.getExactType().equals(TypeX.OBJECT))
+ {
scope.message(IMessage.ERROR, p, "incompatible type, expected " +
parameterTypes[i].getName() + " found " + p);
return;
);
return Pointcut.makeMatchesNothing(Pointcut.CONCRETE);
}
- //??? error if we don't find
//System.err.println("start: " + searchStart);
ResolvedTypeX[] parameterTypes = searchStart.getWorld().resolve(pointcutDec.getParameterTypes());
for (int i=0,len=arguments.size(); i < len; i++) {
TypePattern p = arguments.get(i);
//we are allowed to bind to pointcuts which use subtypes as this is type safe
- if (!p.matchesSubtypes(parameterTypes[i])) {
+ if (!p.matchesSubtypes(parameterTypes[i]) &&
+ !p.getExactType().equals(TypeX.OBJECT))
+ {
throw new BCException("illegal change to pointcut declaration: " + this);
}