// no warnings for declare error/warning
if (munger instanceof Checker) {
return;
}
World world = shadow.getIWorld();
// warning never needed if the declaring type is any
UnresolvedType exactDeclaringType = signature.getDeclaringType().getExactType();
ResolvedType shadowDeclaringType = shadow.getSignature().getDeclaringType().resolve(world);
if (signature.getDeclaringType().isStar() || ResolvedType.isMissing(exactDeclaringType)
|| exactDeclaringType.resolve(world).isMissing()) {
return;
}
// warning not needed if match type couldn't ever be the declaring type
if (!shadowDeclaringType.isAssignableFrom(exactDeclaringType.resolve(world))) {
return;
}
// if the method in the declaring type is *not* visible to the
// exact declaring type then warning not needed.
ResolvedMember rm = shadow.getSignature().resolve(world);
// rm can be null in the case where we are binary weaving, and looking at a class with a call to a method in another class,
// but because of class incompatibilities, the method does not exist on the target class anymore.
// this will be reported elsewhere.
if (rm == null) {
return;
}
int shadowModifiers = rm.getModifiers();
if (!ResolvedType.isVisible(shadowModifiers, shadowDeclaringType, exactDeclaringType.resolve(world))) {
return;
}
if (!signature.getReturnType().matchesStatically(shadow.getSignature().getReturnType().resolve(world))) {
// Covariance issue...
// The reason we didn't match is that the type pattern for the pointcut (Car) doesn't match the
// return type for the specific declaration at the shadow. (FastCar Sub.getCar())
// XXX Put out another XLINT in this case?
return;
}
// PR60015 - Don't report the warning if the declaring type is object and 'this' is an interface
if (exactDeclaringType.resolve(world).isInterface() && shadowDeclaringType.equals(world.resolve("java.lang.Object"))) {
return;
}
SignaturePattern nonConfusingPattern = new SignaturePattern(signature.getKind(), signature.getModifiers(), signature
.getReturnType(), TypePattern.ANY, signature.getName(), signature.getParameterTypes(),