@Override protected ASTRewrite getRewrite() throws CoreException { CompilationUnit astRoot= (CompilationUnit) fInvocationNode.getRoot(); ASTNode methodDecl= astRoot.findDeclaringNode(fSenderBinding); ASTNode newMethodDecl= null; if (methodDecl != null) { newMethodDecl= methodDecl; } else { astRoot= ASTResolving.createQuickFixAST(getCompilationUnit(), null); newMethodDecl= astRoot.findDeclaringNode(fSenderBinding.getKey()); } createImportRewrite(astRoot); if (newMethodDecl instanceof MethodDeclaration) { MethodDeclaration decl= (MethodDeclaration) newMethodDecl; ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST()); if (fParameterChanges != null) { modifyParameters(rewrite, decl); } if (fExceptionChanges != null) { modifyExceptions(rewrite, decl); } return rewrite; } return null; }
@Override protected ASTRewrite getRewrite() throws CoreException { CompilationUnit astRoot= (CompilationUnit) fInvocationNode.getRoot(); ASTNode methodDecl= astRoot.findDeclaringNode(fSenderBinding); ASTNode newMethodDecl= null; if (methodDecl != null) { newMethodDecl= methodDecl; } else { astRoot= ASTResolving.createQuickFixAST(getCompilationUnit(), null); newMethodDecl= astRoot.findDeclaringNode(fSenderBinding.getKey()); } createImportRewrite(astRoot); if (newMethodDecl instanceof MethodDeclaration) { MethodDeclaration decl= (MethodDeclaration) newMethodDecl; ASTRewrite rewrite= ASTRewrite.create(astRoot.getAST()); if (fParameterChanges != null) { modifyParameters(rewrite, decl); } if (fExceptionChanges != null) { modifyExceptions(rewrite, decl); } return rewrite; } return null; }