@Override public void endVisit(CompilationUnit node) { ASTNode enclosingNode= null; if (!getStatus().hasFatalError() && hasSelectedNodes()) enclosingNode= SurroundWithAnalyzer.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 { fExceptions= new ITypeBinding[] { node.getAST().resolveWellKnownType("java.lang.Exception") }; //$NON-NLS-1$ } } } } }
ASTNode enclosingNode = SurroundWithAnalyzer.getEnclosingNode(selectedNode); if (enclosingNode == null) { return;
ASTNode enclosingNode= SurroundWithAnalyzer.getEnclosingNode(selectedNode); if (enclosingNode == null) { return;
break superCall; enclosingNode= getEnclosingNode(getFirstSelectedNode()); boolean isValidEnclosingNode= enclosingNode instanceof MethodDeclaration || enclosingNode instanceof Initializer; if (fSurroundWithTryCatch) {