use of org.eclipse.jdt.core.dom.MethodReference in project eclipse.jdt.ls by eclipse.
the class SurroundWithTryCatchAnalyzer method endVisit.
@Override
public void endVisit(CompilationUnit node) {
ASTNode enclosingNode = null;
if (!getStatus().hasFatalError() && hasSelectedNodes()) {
enclosingNode = getEnclosingNode(getFirstSelectedNode());
}
super.endVisit(node);
if (enclosingNode != null && !getStatus().hasFatalError()) {
fExceptions = ExceptionAnalyzer.perform(enclosingNode, getSelection());
if (fExceptions == null || fExceptions.length == 0) {
if (enclosingNode instanceof MethodReference) {
invalidSelection(RefactoringCoreMessages.SurroundWithTryCatchAnalyzer_doesNotContain);
} else {
// $NON-NLS-1$
fExceptions = new ITypeBinding[] { node.getAST().resolveWellKnownType("java.lang.Exception") };
}
}
}
}
Aggregations