Search in sources :

Example 1 with LinkedProposalPositionGroup

use of org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup in project che by eclipse.

the class ExtractToNullCheckedLocalProposal method getRewrite.

@Override
protected ASTRewrite getRewrite() throws CoreException {
    // infrastructure:
    AST ast = this.compilationUnit.getAST();
    ASTRewrite rewrite = ASTRewrite.create(ast);
    ImportRewrite imports = ImportRewrite.create(this.compilationUnit, true);
    TextEditGroup group = new TextEditGroup(FixMessages.ExtractToNullCheckedLocalProposal_extractCheckedLocal_editName);
    LinkedProposalPositionGroup localNameGroup = new LinkedProposalPositionGroup(LOCAL_NAME_POSITION_GROUP);
    getLinkedProposalModel().addPositionGroup(localNameGroup);
    // AST context:
    Statement origStmt = (Statement) ASTNodes.getParent(this.fieldReference, Statement.class);
    // determine suitable strategy for rearranging elements towards a new code structure:
    RearrangeStrategy rearrangeStrategy = RearrangeStrategy.create(origStmt, rewrite, group);
    Expression toReplace;
    ASTNode directParent = this.fieldReference.getParent();
    if (directParent instanceof FieldAccess) {
        toReplace = (Expression) directParent;
    } else if (directParent instanceof QualifiedName && this.fieldReference.getLocationInParent() == QualifiedName.NAME_PROPERTY) {
        toReplace = (Expression) directParent;
    } else {
        toReplace = this.fieldReference;
    }
    // new local declaration initialized from the field reference
    VariableDeclarationFragment localFrag = ast.newVariableDeclarationFragment();
    VariableDeclarationStatement localDecl = ast.newVariableDeclarationStatement(localFrag);
    // ... type
    localDecl.setType(newType(toReplace.resolveTypeBinding(), ast, imports));
    localDecl.modifiers().add(ast.newModifier(Modifier.ModifierKeyword.FINAL_KEYWORD));
    // ... name
    String localName = proposeLocalName(this.fieldReference, this.compilationUnit, getCompilationUnit().getJavaProject());
    localFrag.setName(ast.newSimpleName(localName));
    // ... initialization
    localFrag.setInitializer((Expression) ASTNode.copySubtree(ast, toReplace));
    rearrangeStrategy.insertLocalDecl(localDecl);
    // if statement:
    IfStatement ifStmt = ast.newIfStatement();
    // condition:
    InfixExpression nullCheck = ast.newInfixExpression();
    nullCheck.setLeftOperand(ast.newSimpleName(localName));
    nullCheck.setRightOperand(ast.newNullLiteral());
    nullCheck.setOperator(InfixExpression.Operator.NOT_EQUALS);
    ifStmt.setExpression(nullCheck);
    // then block: the original statement
    Block thenBlock = ast.newBlock();
    thenBlock.statements().add(rearrangeStrategy.createMoveTargetForOrigStmt());
    ifStmt.setThenStatement(thenBlock);
    // ... but with the field reference replaced by the new local:
    SimpleName dereferencedName = ast.newSimpleName(localName);
    rewrite.replace(toReplace, dereferencedName, group);
    // else block: a Todo comment
    Block elseBlock = ast.newBlock();
    //$NON-NLS-1$
    String elseStatement = "// TODO " + FixMessages.ExtractToNullCheckedLocalProposal_todoHandleNullDescription;
    if (origStmt instanceof ReturnStatement) {
        Type returnType = newType(((ReturnStatement) origStmt).getExpression().resolveTypeBinding(), ast, imports);
        ReturnStatement returnStatement = ast.newReturnStatement();
        returnStatement.setExpression(ASTNodeFactory.newDefaultExpression(ast, returnType, 0));
        elseStatement += '\n' + ASTNodes.asFormattedString(returnStatement, 0, String.valueOf('\n'), getCompilationUnit().getJavaProject().getOptions(true));
    }
    EmptyStatement todoNode = (EmptyStatement) rewrite.createStringPlaceholder(elseStatement, ASTNode.EMPTY_STATEMENT);
    elseBlock.statements().add(todoNode);
    ifStmt.setElseStatement(elseBlock);
    // link all three occurrences of the new local variable:
    addLinkedPosition(rewrite.track(localFrag.getName()), true, /*first*/
    LOCAL_NAME_POSITION_GROUP);
    addLinkedPosition(rewrite.track(nullCheck.getLeftOperand()), false, LOCAL_NAME_POSITION_GROUP);
    addLinkedPosition(rewrite.track(dereferencedName), false, LOCAL_NAME_POSITION_GROUP);
    rearrangeStrategy.insertIfStatement(ifStmt, thenBlock);
    return rewrite;
}
Also used : AST(org.eclipse.jdt.core.dom.AST) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) Statement(org.eclipse.jdt.core.dom.Statement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) EmptyStatement(org.eclipse.jdt.core.dom.EmptyStatement) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) QualifiedName(org.eclipse.jdt.core.dom.QualifiedName) SimpleName(org.eclipse.jdt.core.dom.SimpleName) EmptyStatement(org.eclipse.jdt.core.dom.EmptyStatement) IfStatement(org.eclipse.jdt.core.dom.IfStatement) Type(org.eclipse.jdt.core.dom.Type) PrimitiveType(org.eclipse.jdt.core.dom.PrimitiveType) ParameterizedType(org.eclipse.jdt.core.dom.ParameterizedType) Expression(org.eclipse.jdt.core.dom.Expression) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) VariableDeclarationFragment(org.eclipse.jdt.core.dom.VariableDeclarationFragment) ASTNode(org.eclipse.jdt.core.dom.ASTNode) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) ReturnStatement(org.eclipse.jdt.core.dom.ReturnStatement) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) VariableDeclarationStatement(org.eclipse.jdt.core.dom.VariableDeclarationStatement) Block(org.eclipse.jdt.core.dom.Block) FieldAccess(org.eclipse.jdt.core.dom.FieldAccess) TextEditGroup(org.eclipse.text.edits.TextEditGroup) LinkedProposalPositionGroup(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup)

Example 2 with LinkedProposalPositionGroup

use of org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup in project che by eclipse.

the class LinkedCorrectionProposal method performChange.

/* (non-Javadoc)
	 * @see org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal#performChange(org.eclipse.jface.text.IDocument, org.eclipse.ui.IEditorPart)
	 */
@Override
protected void performChange(/*IEditorPart part,*/
IDocument document) throws CoreException {
    //		try {
    super.performChange(/*part,*/
    document);
    //
    if (fLinkedProposalModel != null) {
        if (fLinkedProposalModel.hasLinkedPositions()) {
            // enter linked mode
            //					ITextViewer viewer= ((JavaEditor) part).getViewer();
            //					new LinkedProposalModelPresenter().enterLinkedMode(viewer, part, didOpenEditor(), fLinkedProposalModel);
            boolean added = false;
            LinkedModeModelImpl model = new LinkedModeModelImpl();
            Iterator<LinkedProposalPositionGroup> iterator = fLinkedProposalModel.getPositionGroupIterator();
            while (iterator.hasNext()) {
                LinkedProposalPositionGroup curr = iterator.next();
                LinkedPositionGroupImpl group = new LinkedPositionGroupImpl();
                LinkedProposalPositionGroup.PositionInformation[] positions = curr.getPositions();
                if (positions.length > 0) {
                    LinkedProposalPositionGroup.Proposal[] linkedModeProposals = curr.getProposals();
                    if (linkedModeProposals.length <= 1) {
                        for (int i = 0; i < positions.length; i++) {
                            LinkedProposalPositionGroup.PositionInformation pos = positions[i];
                            if (pos.getOffset() != -1) {
                                RegionImpl position = new RegionImpl();
                                position.setOffset(pos.getOffset());
                                position.setLength(pos.getLength());
                                //                                        group.addPositions(
                                //                                                new LinkedPosition(document, pos.getOffset(), pos.getLength(), pos.getSequenceRank()));
                                group.addPositions(position);
                            }
                        }
                    } else {
                        //                                LinkedPositionProposalImpl[] proposalImpls= new LinkedPositionProposalImpl[linkedModeProposals.length];
                        LinkedDataImpl data = new LinkedDataImpl();
                        for (int i = 0; i < linkedModeProposals.length; i++) {
                            //                                    proposalImpls[i] = new LinkedPositionProposalImpl(linkedModeProposals[i], model);
                            data.addValues(linkedModeProposals[i].getDisplayString());
                        }
                        group.setData(data);
                        for (int i = 0; i < positions.length; i++) {
                            LinkedProposalPositionGroup.PositionInformation pos = positions[i];
                            if (pos.getOffset() != -1) {
                                //                                        group.addPosition(
                                //                                                new ProposalPosition(document, pos.getOffset(), pos.getLength(), pos.getSequenceRank(),
                                //                                                                     proposalImpls));
                                RegionImpl position = new RegionImpl();
                                position.setOffset(pos.getOffset());
                                position.setLength(pos.getLength());
                                group.addPositions(position);
                            }
                        }
                    }
                    model.addGroups(group);
                    added = true;
                }
            }
            if (added) {
                LinkedProposalPositionGroup.PositionInformation endPosition = fLinkedProposalModel.getEndPosition();
                if (endPosition != null && endPosition.getOffset() != -1) {
                    model.setEscapePosition(endPosition.getOffset() + endPosition.getLength());
                }
                this.linkedModel = model;
            }
        }
    //				else if (part instanceof ITextEditor) {
    //					LinkedProposalPositionGroup.PositionInformation endPosition= fLinkedProposalModel.getEndPosition();
    //					if (endPosition != null) {
    //						// select a result
    //						int pos= endPosition.getOffset() + endPosition.getLength();
    //						((ITextEditor) part).selectAndReveal(pos, 0);
    //					}
    //				}
    }
//		} catch (BadLocationException e) {
//			throw new CoreException(JavaUIStatus.createError(IStatus.ERROR, e));
//		}
}
Also used : LinkedPositionGroupImpl(org.eclipse.che.plugin.java.server.dto.DtoServerImpls.LinkedPositionGroupImpl) LinkedModeModelImpl(org.eclipse.che.plugin.java.server.dto.DtoServerImpls.LinkedModeModelImpl) LinkedDataImpl(org.eclipse.che.plugin.java.server.dto.DtoServerImpls.LinkedDataImpl) RegionImpl(org.eclipse.che.plugin.java.server.dto.DtoServerImpls.RegionImpl) LinkedProposalPositionGroup(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup) ASTRewriteCorrectionProposal(org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal)

Example 3 with LinkedProposalPositionGroup

use of org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup in project che by eclipse.

the class ModifierCorrectionSubProcessor method installLinkedVisibilityProposals.

public static void installLinkedVisibilityProposals(LinkedProposalModel linkedProposalModel, ASTRewrite rewrite, List<IExtendedModifier> modifiers, boolean inInterface) {
    ASTNode modifier = findVisibilityModifier(modifiers);
    if (modifier != null) {
        int selected = ((Modifier) modifier).getKeyword().toFlagValue();
        LinkedProposalPositionGroup positionGroup = linkedProposalModel.getPositionGroup(KEY_MODIFIER, true);
        positionGroup.addPosition(rewrite.track(modifier), false);
        positionGroup.addProposal(new ModifierLinkedModeProposal(selected, 10));
        // add all others
        int[] flagValues = inInterface ? new int[] { Modifier.PUBLIC, 0 } : new int[] { Modifier.PUBLIC, 0, Modifier.PROTECTED, Modifier.PRIVATE };
        for (int i = 0; i < flagValues.length; i++) {
            if (flagValues[i] != selected) {
                positionGroup.addProposal(new ModifierLinkedModeProposal(flagValues[i], 9 - i));
            }
        }
    }
}
Also used : ASTNode(org.eclipse.jdt.core.dom.ASTNode) LinkedProposalPositionGroup(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup)

Example 4 with LinkedProposalPositionGroup

use of org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup in project che by eclipse.

the class ConvertAnonymousToNestedRefactoring method createNewNestedClass.

private AbstractTypeDeclaration createNewNestedClass(CompilationUnitRewrite rewrite, ITypeBinding[] typeParameters) throws CoreException {
    final AST ast = fAnonymousInnerClassNode.getAST();
    final TypeDeclaration newDeclaration = ast.newTypeDeclaration();
    newDeclaration.setInterface(false);
    newDeclaration.setJavadoc(null);
    newDeclaration.modifiers().addAll(ASTNodeFactory.newModifiers(ast, createModifiersForNestedClass()));
    newDeclaration.setName(ast.newSimpleName(fClassName));
    TypeParameter parameter = null;
    for (int index = 0; index < typeParameters.length; index++) {
        parameter = ast.newTypeParameter();
        parameter.setName(ast.newSimpleName(typeParameters[index].getName()));
        newDeclaration.typeParameters().add(parameter);
    }
    setSuperType(newDeclaration);
    IJavaProject project = fCu.getJavaProject();
    IVariableBinding[] bindings = getUsedLocalVariables();
    ArrayList<String> fieldNames = new ArrayList<String>();
    for (int i = 0; i < bindings.length; i++) {
        String name = StubUtility.getBaseName(bindings[i], project);
        String[] fieldNameProposals = StubUtility.getVariableNameSuggestions(NamingConventions.VK_INSTANCE_FIELD, project, name, 0, fieldNames, true);
        fieldNames.add(fieldNameProposals[0]);
        if (fLinkedProposalModel != null) {
            LinkedProposalPositionGroup positionGroup = fLinkedProposalModel.getPositionGroup(KEY_FIELD_NAME_EXT + i, true);
            for (int k = 0; k < fieldNameProposals.length; k++) {
                positionGroup.addProposal(fieldNameProposals[k], null, fieldNameProposals.length - k);
            }
        }
    }
    String[] allFieldNames = fieldNames.toArray(new String[fieldNames.size()]);
    List<BodyDeclaration> newBodyDeclarations = newDeclaration.bodyDeclarations();
    createFieldsForAccessedLocals(rewrite, bindings, allFieldNames, newBodyDeclarations);
    MethodDeclaration newConstructorDecl = createNewConstructor(rewrite, bindings, allFieldNames);
    if (newConstructorDecl != null) {
        newBodyDeclarations.add(newConstructorDecl);
    }
    updateAndMoveBodyDeclarations(rewrite, bindings, allFieldNames, newBodyDeclarations, newConstructorDecl);
    if (doAddComments()) {
        String[] parameterNames = new String[typeParameters.length];
        for (int index = 0; index < parameterNames.length; index++) {
            parameterNames[index] = typeParameters[index].getName();
        }
        String string = CodeGeneration.getTypeComment(rewrite.getCu(), fClassName, parameterNames, StubUtility.getLineDelimiterUsed(fCu));
        if (string != null) {
            Javadoc javadoc = (Javadoc) rewrite.getASTRewrite().createStringPlaceholder(string, ASTNode.JAVADOC);
            newDeclaration.setJavadoc(javadoc);
        }
    }
    if (fLinkedProposalModel != null) {
        addLinkedPosition(KEY_TYPE_NAME, newDeclaration.getName(), rewrite.getASTRewrite(), false);
        ModifierCorrectionSubProcessor.installLinkedVisibilityProposals(fLinkedProposalModel, rewrite.getASTRewrite(), newDeclaration.modifiers(), false);
    }
    return newDeclaration;
}
Also used : AST(org.eclipse.jdt.core.dom.AST) TypeParameter(org.eclipse.jdt.core.dom.TypeParameter) MethodDeclaration(org.eclipse.jdt.core.dom.MethodDeclaration) ArrayList(java.util.ArrayList) Javadoc(org.eclipse.jdt.core.dom.Javadoc) IVariableBinding(org.eclipse.jdt.core.dom.IVariableBinding) IJavaProject(org.eclipse.jdt.core.IJavaProject) BodyDeclaration(org.eclipse.jdt.core.dom.BodyDeclaration) AbstractTypeDeclaration(org.eclipse.jdt.core.dom.AbstractTypeDeclaration) TypeDeclaration(org.eclipse.jdt.core.dom.TypeDeclaration) LinkedProposalPositionGroup(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup)

Example 5 with LinkedProposalPositionGroup

use of org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup in project che by eclipse.

the class ConvertAnonymousToNestedRefactoring method createNewConstructor.

private MethodDeclaration createNewConstructor(CompilationUnitRewrite rewrite, IVariableBinding[] bindings, String[] fieldNames) throws JavaModelException {
    ClassInstanceCreation instanceCreation = (ClassInstanceCreation) fAnonymousInnerClassNode.getParent();
    if (instanceCreation.arguments().isEmpty() && bindings.length == 0)
        return null;
    IJavaProject project = fCu.getJavaProject();
    AST ast = rewrite.getAST();
    ImportRewrite importRewrite = rewrite.getImportRewrite();
    ASTRewrite astRewrite = rewrite.getASTRewrite();
    MethodDeclaration newConstructor = ast.newMethodDeclaration();
    newConstructor.setConstructor(true);
    newConstructor.setJavadoc(null);
    newConstructor.modifiers().addAll(ASTNodeFactory.newModifiers(ast, fVisibility));
    newConstructor.setName(ast.newSimpleName(fClassName));
    addLinkedPosition(KEY_TYPE_NAME, newConstructor.getName(), astRewrite, false);
    newConstructor.setBody(ast.newBlock());
    List<Statement> newStatements = newConstructor.getBody().statements();
    List<SingleVariableDeclaration> newParameters = newConstructor.parameters();
    List<String> newParameterNames = new ArrayList<String>();
    // add parameters for elements passed with the instance creation
    if (!instanceCreation.arguments().isEmpty()) {
        IMethodBinding constructorBinding = getSuperConstructorBinding();
        if (constructorBinding != null) {
            SuperConstructorInvocation superConstructorInvocation = ast.newSuperConstructorInvocation();
            ITypeBinding[] parameterTypes = constructorBinding.getParameterTypes();
            String[][] parameterNames = StubUtility.suggestArgumentNamesWithProposals(project, constructorBinding);
            for (int i = 0; i < parameterNames.length; i++) {
                String[] nameProposals = parameterNames[i];
                String paramName = nameProposals[0];
                SingleVariableDeclaration param = newParameterDeclaration(ast, importRewrite, paramName, parameterTypes[i]);
                newParameters.add(param);
                newParameterNames.add(paramName);
                SimpleName newSIArgument = ast.newSimpleName(paramName);
                superConstructorInvocation.arguments().add(newSIArgument);
                if (fLinkedProposalModel != null) {
                    LinkedProposalPositionGroup positionGroup = fLinkedProposalModel.getPositionGroup(KEY_PARAM_NAME_CONST + String.valueOf(i), true);
                    positionGroup.addPosition(astRewrite.track(param.getName()), false);
                    positionGroup.addPosition(astRewrite.track(newSIArgument), false);
                    for (int k = 0; k < nameProposals.length; k++) {
                        positionGroup.addProposal(nameProposals[k], null, nameProposals.length - k);
                    }
                }
            }
            newStatements.add(superConstructorInvocation);
        }
    }
    // add parameters for all outer variables used
    boolean useThisAccess = useThisForFieldAccess();
    for (int i = 0; i < bindings.length; i++) {
        String baseName = StubUtility.getBaseName(bindings[i], project);
        String[] paramNameProposals = StubUtility.getVariableNameSuggestions(NamingConventions.VK_PARAMETER, project, baseName, 0, newParameterNames, true);
        String paramName = paramNameProposals[0];
        SingleVariableDeclaration param = newParameterDeclaration(ast, importRewrite, paramName, bindings[i].getType());
        newParameters.add(param);
        newParameterNames.add(paramName);
        String fieldName = fieldNames[i];
        SimpleName fieldNameNode = ast.newSimpleName(fieldName);
        SimpleName paramNameNode = ast.newSimpleName(paramName);
        newStatements.add(newFieldAssignment(ast, fieldNameNode, paramNameNode, useThisAccess || newParameterNames.contains(fieldName)));
        if (fLinkedProposalModel != null) {
            LinkedProposalPositionGroup positionGroup = fLinkedProposalModel.getPositionGroup(KEY_PARAM_NAME_EXT + String.valueOf(i), true);
            positionGroup.addPosition(astRewrite.track(param.getName()), false);
            positionGroup.addPosition(astRewrite.track(paramNameNode), false);
            for (int k = 0; k < paramNameProposals.length; k++) {
                positionGroup.addProposal(paramNameProposals[k], null, paramNameProposals.length - k);
            }
            fLinkedProposalModel.getPositionGroup(KEY_FIELD_NAME_EXT + i, true).addPosition(astRewrite.track(fieldNameNode), false);
        }
    }
    addExceptionsToNewConstructor(newConstructor, importRewrite);
    if (doAddComments()) {
        try {
            String[] allParamNames = newParameterNames.toArray(new String[newParameterNames.size()]);
            String string = CodeGeneration.getMethodComment(fCu, fClassName, fClassName, allParamNames, new String[0], null, new String[0], null, StubUtility.getLineDelimiterUsed(fCu));
            if (string != null) {
                Javadoc javadoc = (Javadoc) astRewrite.createStringPlaceholder(string, ASTNode.JAVADOC);
                newConstructor.setJavadoc(javadoc);
            }
        } catch (CoreException exception) {
            throw new JavaModelException(exception);
        }
    }
    return newConstructor;
}
Also used : IMethodBinding(org.eclipse.jdt.core.dom.IMethodBinding) JavaModelException(org.eclipse.jdt.core.JavaModelException) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) SimpleName(org.eclipse.jdt.core.dom.SimpleName) ArrayList(java.util.ArrayList) Javadoc(org.eclipse.jdt.core.dom.Javadoc) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) ClassInstanceCreation(org.eclipse.jdt.core.dom.ClassInstanceCreation) AST(org.eclipse.jdt.core.dom.AST) MethodDeclaration(org.eclipse.jdt.core.dom.MethodDeclaration) Statement(org.eclipse.jdt.core.dom.Statement) SingleVariableDeclaration(org.eclipse.jdt.core.dom.SingleVariableDeclaration) IJavaProject(org.eclipse.jdt.core.IJavaProject) CoreException(org.eclipse.core.runtime.CoreException) SuperConstructorInvocation(org.eclipse.jdt.core.dom.SuperConstructorInvocation) LinkedProposalPositionGroup(org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup)

Aggregations

LinkedProposalPositionGroup (org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup)12 AST (org.eclipse.jdt.core.dom.AST)8 ASTRewrite (org.eclipse.jdt.core.dom.rewrite.ASTRewrite)7 ASTNode (org.eclipse.jdt.core.dom.ASTNode)6 Expression (org.eclipse.jdt.core.dom.Expression)6 MethodDeclaration (org.eclipse.jdt.core.dom.MethodDeclaration)5 Type (org.eclipse.jdt.core.dom.Type)5 VariableDeclarationFragment (org.eclipse.jdt.core.dom.VariableDeclarationFragment)5 VariableDeclarationStatement (org.eclipse.jdt.core.dom.VariableDeclarationStatement)5 AbstractTypeDeclaration (org.eclipse.jdt.core.dom.AbstractTypeDeclaration)4 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)4 ReturnStatement (org.eclipse.jdt.core.dom.ReturnStatement)4 ArrayList (java.util.ArrayList)3 Block (org.eclipse.jdt.core.dom.Block)3 FieldDeclaration (org.eclipse.jdt.core.dom.FieldDeclaration)3 IMethodBinding (org.eclipse.jdt.core.dom.IMethodBinding)3 Javadoc (org.eclipse.jdt.core.dom.Javadoc)3 SimpleName (org.eclipse.jdt.core.dom.SimpleName)3 VariableDeclarationExpression (org.eclipse.jdt.core.dom.VariableDeclarationExpression)3 ImportRewrite (org.eclipse.jdt.core.dom.rewrite.ImportRewrite)3