private static SourceProvider resolveSourceProvider(RefactoringStatus status, ICompilationUnit unit, ASTNode invocation) throws JavaModelException {
private static SourceProvider resolveSourceProvider(RefactoringStatus status, IJavaElement unit, ASTNode invocation) throws JavaModelException {
	private static SourceProvider resolveSourceProvider(RefactoringStatus status, ICompilationUnit unit, ASTNode invocation) throws JavaModelException {		CompilationUnit root= (CompilationUnit)invocation.getRoot();		IMethodBinding methodBinding= Invocations.resolveBinding(invocation);		if (methodBinding == null) {			status.addFatalError(RefactoringCoreMessages.InlineMethodRefactoring_error_noMethodDeclaration); 			return null;		}		MethodDeclaration declaration= (MethodDeclaration)root.findDeclaringNode(methodBinding);		if (declaration != null) {			return new SourceProvider(unit, declaration);		}		IMethod method= (IMethod)methodBinding.getJavaElement();		if (method != null) {			ICompilationUnit source= method.getCompilationUnit();			if (source == null) {				status.addFatalError(Messages.format(RefactoringCoreMessages.InlineMethodRefactoring_error_classFile, method.getElementName())); 				return null;			}			ASTParser parser= ASTParser.newParser(AST.JLS3);			parser.setSource(source);			parser.setResolveBindings(true);			CompilationUnit astRoot= (CompilationUnit) parser.createAST(null);			ASTNode node= astRoot.findDeclaringNode(methodBinding.getKey());			if (node instanceof MethodDeclaration) {				return new SourceProvider(source, (MethodDeclaration) node);			}		}		status.addFatalError(RefactoringCoreMessages.InlineMethodRefactoring_error_noMethodDeclaration); 		return null;	}