// remove any unnecessary exceptions if the compiler option is set to
// error or warning and if this piece of advice throws exceptions
// (bug 129282). This may be expanded to include other compiler warnings
// at the moment it only deals with 'declared exception is not thrown'
if (!shadow.getWorld().isIgnoringUnusedDeclaredThrownException() && !getThrownExceptions().isEmpty()) {
Member member = shadow.getSignature();
if (member instanceof BcelMethod) {
removeUnnecessaryProblems((BcelMethod) member, ((BcelMethod) member).getDeclarationLineNumber());
} else {
// we're in a call shadow therefore need the line number of the
// declared method (which may be in a different type). However,
// we want to remove the problems from the CompilationResult
// held within the current type's EclipseSourceContext so need
// the enclosing shadow too
ResolvedMember resolvedMember = shadow.getSignature().resolve(shadow.getWorld());
if (resolvedMember instanceof BcelMethod && shadow.getEnclosingShadow() instanceof BcelShadow) {
Member enclosingMember = shadow.getEnclosingShadow().getSignature();
if (enclosingMember instanceof BcelMethod) {
removeUnnecessaryProblems((BcelMethod) enclosingMember,
((BcelMethod) resolvedMember).getDeclarationLineNumber());
}
}
}
}
if (shadow.getIWorld().isJoinpointSynchronizationEnabled() && shadow.getKind() == Shadow.MethodExecution
&& (s.getSignature().getModifiers() & Modifier.SYNCHRONIZED) != 0) {
shadow.getIWorld().getLint().advisingSynchronizedMethods.signal(new String[] { shadow.toString() },
shadow.getSourceLocation(), new ISourceLocation[] { getSourceLocation() });
}
// FIXME AV - see #75442, this logic is not enough so for now comment it out until we fix the bug
// // callback for perObject AJC MightHaveAspect postMunge (#75442)
// if (getConcreteAspect() != null
// && getConcreteAspect().getPerClause() != null
// && PerClause.PEROBJECT.equals(getConcreteAspect().getPerClause().getKind())) {
// final PerObject clause;
// if (getConcreteAspect().getPerClause() instanceof PerFromSuper) {
// clause = (PerObject)((PerFromSuper) getConcreteAspect().getPerClause()).lookupConcretePerClause(getConcreteAspect());
// } else {
// clause = (PerObject) getConcreteAspect().getPerClause();
// }
// if (clause.isThis()) {
// PerObjectInterfaceTypeMunger.registerAsAdvisedBy(s.getThisVar().getType(), getConcreteAspect());
// } else {
// PerObjectInterfaceTypeMunger.registerAsAdvisedBy(s.getTargetVar().getType(), getConcreteAspect());
// }
// }
if (runtimeTest == Literal.FALSE) { // not usually allowed, except in one case (260384)
Member sig = shadow.getSignature();
if (sig.getArity() == 0 && shadow.getKind() == Shadow.MethodCall && sig.getName().charAt(0) == 'c'
&& sig.getReturnType().equals(ResolvedType.OBJECT) && sig.getName().equals("clone")) {
return false;
}
}
if (getKind() == AdviceKind.Before) {