fAST= root.getAST(); ASTNode node= NodeFinder.perform(root, offset, length); if (!(node instanceof Name)) { return SearchMessages.ExceptionOccurrencesFinder_no_exception; } fSelectedName= ASTNodes.getTopMostName((Name)node); ASTNode parent= fSelectedName.getParent(); MethodDeclaration decl= resolveMethodDeclaration(parent); if (decl != null && methodThrowsException(decl, fSelectedName)) { fException= fSelectedName.resolveTypeBinding(); fStart= decl.getBody(); } else if (parent instanceof Type) { parent= parent.getParent(); if (parent instanceof SingleVariableDeclaration && parent.getParent() instanceof CatchClause) { CatchClause catchClause= (CatchClause)parent.getParent(); TryStatement tryStatement= (TryStatement)catchClause.getParent(); if (tryStatement != null) { IVariableBinding var= catchClause.getException().resolveBinding(); if (var != null && var.getType() != null) { fException= var.getType(); fStart= tryStatement.getBody(); } } } } if (fException == null || fStart == null) return SearchMessages.ExceptionOccurrencesFinder_no_exception; return null;
return initialize(root, NodeFinder.perform(root, offset, length));
	public String initialize(CompilationUnit root, int offset, int length) {		fAST= root.getAST();		ASTNode node= NodeFinder.perform(root, offset, length);		if (!(node instanceof Name)) {			return SearchMessages.ExceptionOccurrencesFinder_no_exception;  		}		fSelectedName= ASTNodes.getTopMostName((Name)node);		ASTNode parent= fSelectedName.getParent();		MethodDeclaration decl= resolveMethodDeclaration(parent);		if (decl != null && methodThrowsException(decl, fSelectedName)) {			fException= fSelectedName.resolveTypeBinding();			fStart= decl.getBody();		} else if (parent instanceof Type) {			parent= parent.getParent();			if (parent instanceof SingleVariableDeclaration && parent.getParent() instanceof CatchClause) {				CatchClause catchClause= (CatchClause)parent.getParent();				TryStatement tryStatement= (TryStatement)catchClause.getParent();				if (tryStatement != null) {					IVariableBinding var= catchClause.getException().resolveBinding();					if (var != null && var.getType() != null) {						fException= var.getType();						fStart= tryStatement.getBody();					}				}			}		}		if (fException == null || fStart == null)			return SearchMessages.ExceptionOccurrencesFinder_no_exception;  		return null;	}