Search in sources :

Example 11 with ThisExpression

use of org.eclipse.jdt.core.dom.ThisExpression in project flux by eclipse.

the class QuickAssistProcessor method getInvertEqualsProposal.

private static boolean getInvertEqualsProposal(IInvocationContext context, ASTNode node, Collection<ICommandAccess> resultingCollections) {
    if (!(node instanceof MethodInvocation)) {
        node = node.getParent();
        if (!(node instanceof MethodInvocation)) {
            return false;
        }
    }
    MethodInvocation method = (MethodInvocation) node;
    String identifier = method.getName().getIdentifier();
    if (!"equals".equals(identifier) && !"equalsIgnoreCase".equals(identifier)) {
        // $NON-NLS-1$ //$NON-NLS-2$
        return false;
    }
    List<Expression> arguments = method.arguments();
    if (arguments.size() != 1) {
        // overloaded equals w/ more than 1 argument
        return false;
    }
    Expression right = arguments.get(0);
    ITypeBinding binding = right.resolveTypeBinding();
    if (binding != null && !(binding.isClass() || binding.isInterface() || binding.isEnum())) {
        // overloaded equals w/ non-class/interface argument or null
        return false;
    }
    if (resultingCollections == null) {
        return true;
    }
    Expression left = method.getExpression();
    AST ast = method.getAST();
    ASTRewrite rewrite = ASTRewrite.create(ast);
    if (left == null) {
        // equals(x) -> x.equals(this)
        MethodInvocation replacement = ast.newMethodInvocation();
        replacement.setName((SimpleName) rewrite.createCopyTarget(method.getName()));
        replacement.arguments().add(ast.newThisExpression());
        replacement.setExpression((Expression) rewrite.createCopyTarget(right));
        rewrite.replace(method, replacement, null);
    } else if (right instanceof ThisExpression) {
        // x.equals(this) -> equals(x)
        MethodInvocation replacement = ast.newMethodInvocation();
        replacement.setName((SimpleName) rewrite.createCopyTarget(method.getName()));
        replacement.arguments().add(rewrite.createCopyTarget(left));
        rewrite.replace(method, replacement, null);
    } else {
        ASTNode leftExpression = left;
        while (leftExpression instanceof ParenthesizedExpression) {
            leftExpression = ((ParenthesizedExpression) left).getExpression();
        }
        rewrite.replace(right, rewrite.createCopyTarget(leftExpression), null);
        if (right instanceof CastExpression || right instanceof Assignment || right instanceof ConditionalExpression || right instanceof InfixExpression) {
            ParenthesizedExpression paren = ast.newParenthesizedExpression();
            paren.setExpression((Expression) rewrite.createCopyTarget(right));
            rewrite.replace(left, paren, null);
        } else {
            rewrite.replace(left, rewrite.createCopyTarget(right), null);
        }
    }
    String label = CorrectionMessages.QuickAssistProcessor_invertequals_description;
    // Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
    LinkedCorrectionProposal proposal = new LinkedCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.INVERT_EQUALS);
    resultingCollections.add(proposal);
    return true;
}
Also used : ParenthesizedExpression(org.eclipse.jdt.core.dom.ParenthesizedExpression) AST(org.eclipse.jdt.core.dom.AST) SimpleName(org.eclipse.jdt.core.dom.SimpleName) ConditionalExpression(org.eclipse.jdt.core.dom.ConditionalExpression) MethodInvocation(org.eclipse.jdt.core.dom.MethodInvocation) SuperMethodInvocation(org.eclipse.jdt.core.dom.SuperMethodInvocation) Assignment(org.eclipse.jdt.core.dom.Assignment) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) ConditionalExpression(org.eclipse.jdt.core.dom.ConditionalExpression) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) Expression(org.eclipse.jdt.core.dom.Expression) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) CastExpression(org.eclipse.jdt.core.dom.CastExpression) VariableDeclarationExpression(org.eclipse.jdt.core.dom.VariableDeclarationExpression) PostfixExpression(org.eclipse.jdt.core.dom.PostfixExpression) ParenthesizedExpression(org.eclipse.jdt.core.dom.ParenthesizedExpression) LambdaExpression(org.eclipse.jdt.core.dom.LambdaExpression) PrefixExpression(org.eclipse.jdt.core.dom.PrefixExpression) LinkedCorrectionProposal(org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) ASTNode(org.eclipse.jdt.core.dom.ASTNode) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite) CastExpression(org.eclipse.jdt.core.dom.CastExpression)

Example 12 with ThisExpression

use of org.eclipse.jdt.core.dom.ThisExpression in project AutoRefactor by JnRouvignac.

the class CFGBuilder method addVariableAccess.

/**
 * @return whether the current variable access can throw an exception.
 */
private boolean addVariableAccess(final CFGBasicBlock basicBlock, final Expression node, final int flags, final ThrowerBlocks throwers) {
    if (node == null) {
        return false;
    }
    switch(node.getNodeType()) {
        case ASTNode.ARRAY_ACCESS:
            ArrayAccess aa = (ArrayAccess) node;
            addVariableAccess(basicBlock, aa.getArray(), flags, throwers);
            addVariableAccess(basicBlock, aa.getIndex(), flags, throwers);
            throwers.addThrow(aa, newException(node, ArrayIndexOutOfBoundsException.class.getCanonicalName()));
            return true;
        case ASTNode.ARRAY_CREATION:
            ArrayCreation ac = (ArrayCreation) node;
            boolean acMightThrow1 = addVariableAccess(basicBlock, ac.getInitializer(), flags, throwers);
            boolean acMightThrow2 = addVariableAccesses(basicBlock, ac.dimensions(), flags, throwers);
            return acMightThrow1 || acMightThrow2;
        case ASTNode.ARRAY_INITIALIZER:
            ArrayInitializer ai = (ArrayInitializer) node;
            return addVariableAccesses(basicBlock, ai.expressions(), flags, throwers);
        case ASTNode.ASSIGNMENT:
            Assignment a = (Assignment) node;
            boolean aMightThrow1 = addVariableAccess(basicBlock, a.getLeftHandSide(), VariableAccess.WRITE, throwers);
            boolean aMightThrow2 = addVariableAccess(basicBlock, a.getRightHandSide(), VariableAccess.READ, throwers);
            return aMightThrow1 || aMightThrow2;
        case ASTNode.BOOLEAN_LITERAL:
        case ASTNode.CHARACTER_LITERAL:
        case ASTNode.NULL_LITERAL:
        case ASTNode.NUMBER_LITERAL:
        case ASTNode.STRING_LITERAL:
        case ASTNode.TYPE_LITERAL:
            // Nothing to do
            return false;
        case ASTNode.CAST_EXPRESSION:
            CastExpression cae = (CastExpression) node;
            return addVariableAccess(basicBlock, cae.getExpression(), flags, throwers);
        case ASTNode.CLASS_INSTANCE_CREATION:
            ClassInstanceCreation classInstanceCreation = (ClassInstanceCreation) node;
            addVariableAccess(basicBlock, classInstanceCreation.getExpression(), flags, throwers);
            addVariableAccesses(basicBlock, classInstanceCreation.arguments(), flags, throwers);
            IMethodBinding cicBinding = classInstanceCreation.resolveConstructorBinding();
            if (cicBinding != null) {
                ITypeBinding[] declaredThrows = cicBinding.getExceptionTypes();
                throwers.addThrow(classInstanceCreation, declaredThrows);
                return declaredThrows.length > 0;
            }
            return false;
        case ASTNode.CONDITIONAL_EXPRESSION:
            ConditionalExpression coe = (ConditionalExpression) node;
            boolean mightThrow1 = addVariableAccess(basicBlock, coe.getExpression(), flags, throwers);
            boolean mightThrow2 = addVariableAccess(basicBlock, coe.getThenExpression(), flags, throwers);
            boolean mightThrow3 = addVariableAccess(basicBlock, coe.getElseExpression(), flags, throwers);
            return mightThrow1 || mightThrow2 || mightThrow3;
        case ASTNode.FIELD_ACCESS:
            FieldAccess fa = (FieldAccess) node;
            boolean mightThrow = addVariableAccess(basicBlock, fa.getExpression(), flags, throwers);
            basicBlock.addVariableAccess(new VariableAccess(fa, flags));
            if (is(flags, VariableAccess.READ)) {
                throwers.addThrow(fa, newException(node, NullPointerException.class.getCanonicalName()));
                mightThrow = true;
            }
            return mightThrow;
        case ASTNode.INFIX_EXPRESSION:
            InfixExpression infixExpression = (InfixExpression) node;
            boolean ieMightThrow1 = addVariableAccess(basicBlock, infixExpression.getLeftOperand(), flags, throwers);
            boolean ieMightThrow2 = addVariableAccess(basicBlock, infixExpression.getRightOperand(), flags, throwers);
            return ieMightThrow1 || ieMightThrow2;
        case ASTNode.INSTANCEOF_EXPRESSION:
            InstanceofExpression ioe = (InstanceofExpression) node;
            return addVariableAccess(basicBlock, ioe.getLeftOperand(), flags, throwers);
        case ASTNode.METHOD_INVOCATION:
            MethodInvocation methodInvocation = (MethodInvocation) node;
            addVariableAccess(basicBlock, methodInvocation.getExpression(), flags, throwers);
            addVariableAccesses(basicBlock, methodInvocation.arguments(), flags, throwers);
            IMethodBinding methodBinding = methodInvocation.resolveMethodBinding();
            if (methodBinding != null) {
                ITypeBinding[] declaredThrows = methodBinding.getExceptionTypes();
                throwers.addThrow(methodInvocation, declaredThrows);
                return declaredThrows.length > 0;
            }
            return false;
        case ASTNode.SIMPLE_NAME:
            SimpleName sn = (SimpleName) node;
            basicBlock.addVariableAccess(new VariableAccess(sn, flags));
            if (is(flags, VariableAccess.READ)) {
                throwers.addThrow(sn, newException(node, NullPointerException.class.getCanonicalName()));
                return true;
            }
            return false;
        case ASTNode.QUALIFIED_NAME:
            QualifiedName qn = (QualifiedName) node;
            basicBlock.addVariableAccess(new VariableAccess(qn, flags));
            throwers.addThrow(qn, newException(node, NullPointerException.class.getCanonicalName()));
            return true;
        case ASTNode.PARENTHESIZED_EXPRESSION:
            ParenthesizedExpression pe = (ParenthesizedExpression) node;
            return addVariableAccess(basicBlock, pe.getExpression(), flags, throwers);
        case ASTNode.POSTFIX_EXPRESSION:
            PostfixExpression poe = (PostfixExpression) node;
            return addVariableAccess(basicBlock, poe.getOperand(), flags, throwers);
        case ASTNode.PREFIX_EXPRESSION:
            PrefixExpression pre = (PrefixExpression) node;
            return addVariableAccess(basicBlock, pre.getOperand(), flags, throwers);
        case ASTNode.SUPER_FIELD_ACCESS:
            SuperFieldAccess sfa = (SuperFieldAccess) node;
            boolean sfaMightThrow1 = addVariableAccess(basicBlock, sfa.getQualifier(), flags, throwers);
            boolean sfaMightThrow2 = addVariableAccess(basicBlock, sfa.getName(), flags, throwers);
            return sfaMightThrow1 || sfaMightThrow2;
        case ASTNode.SUPER_METHOD_INVOCATION:
            SuperMethodInvocation smi = (SuperMethodInvocation) node;
            addVariableAccess(basicBlock, smi.getQualifier(), flags, throwers);
            addVariableAccess(basicBlock, smi.getName(), flags, throwers);
            IMethodBinding sMethodBinding = smi.resolveMethodBinding();
            if (sMethodBinding != null) {
                ITypeBinding[] declaredThrows = sMethodBinding.getExceptionTypes();
                throwers.addThrow(smi, declaredThrows);
                return declaredThrows.length > 0;
            }
            return false;
        case ASTNode.THIS_EXPRESSION:
            ThisExpression te = (ThisExpression) node;
            // TODO JNR remember use of "this" here
            return addVariableAccess(basicBlock, te.getQualifier(), flags, throwers);
        case ASTNode.VARIABLE_DECLARATION_EXPRESSION:
            return addDeclarations(basicBlock, (VariableDeclarationExpression) node, throwers);
        default:
            throw new NotImplementedException(node);
    }
}
Also used : IMethodBinding(org.eclipse.jdt.core.dom.IMethodBinding) SimpleName(org.eclipse.jdt.core.dom.SimpleName) NotImplementedException(org.autorefactor.util.NotImplementedException) MethodInvocation(org.eclipse.jdt.core.dom.MethodInvocation) SuperMethodInvocation(org.eclipse.jdt.core.dom.SuperMethodInvocation) SuperMethodInvocation(org.eclipse.jdt.core.dom.SuperMethodInvocation) Assignment(org.eclipse.jdt.core.dom.Assignment) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) ArrayAccess(org.eclipse.jdt.core.dom.ArrayAccess) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) InstanceofExpression(org.eclipse.jdt.core.dom.InstanceofExpression) InfixExpression(org.eclipse.jdt.core.dom.InfixExpression) ClassInstanceCreation(org.eclipse.jdt.core.dom.ClassInstanceCreation) ParenthesizedExpression(org.eclipse.jdt.core.dom.ParenthesizedExpression) ConditionalExpression(org.eclipse.jdt.core.dom.ConditionalExpression) QualifiedName(org.eclipse.jdt.core.dom.QualifiedName) SuperFieldAccess(org.eclipse.jdt.core.dom.SuperFieldAccess) PrefixExpression(org.eclipse.jdt.core.dom.PrefixExpression) ArrayCreation(org.eclipse.jdt.core.dom.ArrayCreation) PostfixExpression(org.eclipse.jdt.core.dom.PostfixExpression) CastExpression(org.eclipse.jdt.core.dom.CastExpression) FieldAccess(org.eclipse.jdt.core.dom.FieldAccess) SuperFieldAccess(org.eclipse.jdt.core.dom.SuperFieldAccess) ArrayInitializer(org.eclipse.jdt.core.dom.ArrayInitializer)

Example 13 with ThisExpression

use of org.eclipse.jdt.core.dom.ThisExpression in project AutoRefactor by JnRouvignac.

the class ObsoleteJava7HashRatherThanEclipseJava6HashCleanUp method getField.

private SimpleName getField(final Expression expression) {
    SimpleName simpleName = ASTNodes.as(expression, SimpleName.class);
    if (simpleName != null) {
        return simpleName;
    }
    FieldAccess fieldName = ASTNodes.as(expression, FieldAccess.class);
    if (fieldName != null) {
        ThisExpression te = ASTNodes.as(fieldName.getExpression(), ThisExpression.class);
        if (te != null) {
            if (te.getQualifier() == null) {
                return fieldName.getName();
            }
            if (te.getQualifier().isSimpleName()) {
                SimpleName qualifier = (SimpleName) te.getQualifier();
                TypeDeclaration visitedClass = ASTNodes.getTypedAncestor(expression, TypeDeclaration.class);
                if (visitedClass != null && ASTNodes.isSameVariable(visitedClass.getName(), qualifier)) {
                    return fieldName.getName();
                }
            }
        }
    }
    SuperFieldAccess superFieldAccess = ASTNodes.as(expression, SuperFieldAccess.class);
    if (superFieldAccess != null) {
        if (superFieldAccess.getQualifier() == null) {
            return superFieldAccess.getName();
        }
        if (superFieldAccess.getQualifier().isSimpleName()) {
            SimpleName qualifier = (SimpleName) superFieldAccess.getQualifier();
            TypeDeclaration visitedClass = ASTNodes.getTypedAncestor(expression, TypeDeclaration.class);
            if (visitedClass != null && ASTNodes.isSameVariable(visitedClass.getName(), qualifier)) {
                return superFieldAccess.getName();
            }
        }
    }
    return null;
}
Also used : ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) SimpleName(org.eclipse.jdt.core.dom.SimpleName) SuperFieldAccess(org.eclipse.jdt.core.dom.SuperFieldAccess) FieldAccess(org.eclipse.jdt.core.dom.FieldAccess) SuperFieldAccess(org.eclipse.jdt.core.dom.SuperFieldAccess) TypeDeclaration(org.eclipse.jdt.core.dom.TypeDeclaration)

Example 14 with ThisExpression

use of org.eclipse.jdt.core.dom.ThisExpression in project che by eclipse.

the class ExtractMethodAnalyzer method endVisit.

@Override
public void endVisit(CompilationUnit node) {
    RefactoringStatus status = getStatus();
    superCall: {
        if (status.hasFatalError())
            break superCall;
        if (!hasSelectedNodes()) {
            ASTNode coveringNode = getLastCoveringNode();
            if (coveringNode instanceof Block && coveringNode.getParent() instanceof MethodDeclaration) {
                MethodDeclaration methodDecl = (MethodDeclaration) coveringNode.getParent();
                Message[] messages = ASTNodes.getMessages(methodDecl, ASTNodes.NODE_ONLY);
                if (messages.length > 0) {
                    status.addFatalError(Messages.format(RefactoringCoreMessages.ExtractMethodAnalyzer_compile_errors, BasicElementLabels.getJavaElementName(methodDecl.getName().getIdentifier())), JavaStatusContext.create(fCUnit, methodDecl));
                    break superCall;
                }
            }
            status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_invalid_selection);
            break superCall;
        }
        fEnclosingBodyDeclaration = (BodyDeclaration) ASTNodes.getParent(getFirstSelectedNode(), BodyDeclaration.class);
        if (fEnclosingBodyDeclaration == null || (fEnclosingBodyDeclaration.getNodeType() != ASTNode.METHOD_DECLARATION && fEnclosingBodyDeclaration.getNodeType() != ASTNode.FIELD_DECLARATION && fEnclosingBodyDeclaration.getNodeType() != ASTNode.INITIALIZER)) {
            status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_invalid_selection);
            break superCall;
        } else if (ASTNodes.getEnclosingType(fEnclosingBodyDeclaration) == null) {
            status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_compile_errors_no_parent_binding);
            break superCall;
        } else if (fEnclosingBodyDeclaration.getNodeType() == ASTNode.METHOD_DECLARATION) {
            fEnclosingMethodBinding = ((MethodDeclaration) fEnclosingBodyDeclaration).resolveBinding();
        }
        if (!isSingleExpressionOrStatementSet()) {
            status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_single_expression_or_set);
            break superCall;
        }
        if (isExpressionSelected()) {
            ASTNode expression = getFirstSelectedNode();
            if (expression instanceof Name) {
                Name name = (Name) expression;
                if (name.resolveBinding() instanceof ITypeBinding) {
                    status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_type_reference);
                    break superCall;
                }
                if (name.resolveBinding() instanceof IMethodBinding) {
                    status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_method_name_reference);
                    break superCall;
                }
                if (name.resolveBinding() instanceof IVariableBinding) {
                    StructuralPropertyDescriptor locationInParent = name.getLocationInParent();
                    if (locationInParent == QualifiedName.NAME_PROPERTY || (locationInParent == FieldAccess.NAME_PROPERTY && !(((FieldAccess) name.getParent()).getExpression() instanceof ThisExpression))) {
                        status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_part_of_qualified_name);
                        break superCall;
                    }
                }
                if (name.isSimpleName() && ((SimpleName) name).isDeclaration()) {
                    status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_cannot_extract_name_in_declaration);
                    break superCall;
                }
            }
            fForceStatic = ASTNodes.getParent(expression, ASTNode.SUPER_CONSTRUCTOR_INVOCATION) != null || ASTNodes.getParent(expression, ASTNode.CONSTRUCTOR_INVOCATION) != null;
        }
        status.merge(LocalTypeAnalyzer.perform(fEnclosingBodyDeclaration, getSelection()));
        computeLastStatementSelected();
    }
    super.endVisit(node);
}
Also used : IMethodBinding(org.eclipse.jdt.core.dom.IMethodBinding) Message(org.eclipse.jdt.core.dom.Message) MethodDeclaration(org.eclipse.jdt.core.dom.MethodDeclaration) RefactoringStatus(org.eclipse.ltk.core.refactoring.RefactoringStatus) IVariableBinding(org.eclipse.jdt.core.dom.IVariableBinding) SimpleName(org.eclipse.jdt.core.dom.SimpleName) QualifiedName(org.eclipse.jdt.core.dom.QualifiedName) Name(org.eclipse.jdt.core.dom.Name) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) ASTNode(org.eclipse.jdt.core.dom.ASTNode) Block(org.eclipse.jdt.core.dom.Block) FieldAccess(org.eclipse.jdt.core.dom.FieldAccess) StructuralPropertyDescriptor(org.eclipse.jdt.core.dom.StructuralPropertyDescriptor)

Example 15 with ThisExpression

use of org.eclipse.jdt.core.dom.ThisExpression in project che by eclipse.

the class UnresolvedElementsSubProcessor method addQualifierToOuterProposal.

private static void addQualifierToOuterProposal(IInvocationContext context, MethodInvocation invocationNode, IMethodBinding binding, Collection<ICommandAccess> proposals) {
    ITypeBinding declaringType = binding.getDeclaringClass();
    ITypeBinding parentType = Bindings.getBindingOfParentType(invocationNode);
    ITypeBinding currType = parentType;
    boolean isInstanceMethod = !Modifier.isStatic(binding.getModifiers());
    while (currType != null && !Bindings.isSuperType(declaringType, currType)) {
        if (isInstanceMethod && Modifier.isStatic(currType.getModifiers())) {
            return;
        }
        currType = currType.getDeclaringClass();
    }
    if (currType == null || currType == parentType) {
        return;
    }
    ASTRewrite rewrite = ASTRewrite.create(invocationNode.getAST());
    String label = Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changetoouter_description, ASTResolving.getTypeSignature(currType));
    Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
    ASTRewriteCorrectionProposal proposal = new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.QUALIFY_WITH_ENCLOSING_TYPE, image);
    ImportRewrite imports = proposal.createImportRewrite(context.getASTRoot());
    ImportRewriteContext importRewriteContext = new ContextSensitiveImportRewriteContext(invocationNode, imports);
    AST ast = invocationNode.getAST();
    String qualifier = imports.addImport(currType, importRewriteContext);
    Name name = ASTNodeFactory.newName(ast, qualifier);
    Expression newExpression;
    if (isInstanceMethod) {
        ThisExpression expr = ast.newThisExpression();
        expr.setQualifier(name);
        newExpression = expr;
    } else {
        newExpression = name;
    }
    rewrite.set(invocationNode, MethodInvocation.EXPRESSION_PROPERTY, newExpression, null);
    proposals.add(proposal);
}
Also used : AST(org.eclipse.jdt.core.dom.AST) ImportRewrite(org.eclipse.jdt.core.dom.rewrite.ImportRewrite) Image(org.eclipse.swt.graphics.Image) SimpleName(org.eclipse.jdt.core.dom.SimpleName) QualifiedName(org.eclipse.jdt.core.dom.QualifiedName) Name(org.eclipse.jdt.core.dom.Name) ASTRewriteCorrectionProposal(org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) ContextSensitiveImportRewriteContext(org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) ImportRewriteContext(org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext) ContextSensitiveImportRewriteContext(org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext) ThisExpression(org.eclipse.jdt.core.dom.ThisExpression) Expression(org.eclipse.jdt.core.dom.Expression) CastExpression(org.eclipse.jdt.core.dom.CastExpression) ParenthesizedExpression(org.eclipse.jdt.core.dom.ParenthesizedExpression) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding) ASTRewrite(org.eclipse.jdt.core.dom.rewrite.ASTRewrite)

Aggregations

ThisExpression (org.eclipse.jdt.core.dom.ThisExpression)19 SimpleName (org.eclipse.jdt.core.dom.SimpleName)17 Expression (org.eclipse.jdt.core.dom.Expression)12 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)12 Name (org.eclipse.jdt.core.dom.Name)10 ParenthesizedExpression (org.eclipse.jdt.core.dom.ParenthesizedExpression)10 ASTNode (org.eclipse.jdt.core.dom.ASTNode)9 MethodInvocation (org.eclipse.jdt.core.dom.MethodInvocation)9 CastExpression (org.eclipse.jdt.core.dom.CastExpression)8 FieldAccess (org.eclipse.jdt.core.dom.FieldAccess)8 QualifiedName (org.eclipse.jdt.core.dom.QualifiedName)8 IMethodBinding (org.eclipse.jdt.core.dom.IMethodBinding)6 AST (org.eclipse.jdt.core.dom.AST)5 Assignment (org.eclipse.jdt.core.dom.Assignment)5 Block (org.eclipse.jdt.core.dom.Block)5 IVariableBinding (org.eclipse.jdt.core.dom.IVariableBinding)5 SuperMethodInvocation (org.eclipse.jdt.core.dom.SuperMethodInvocation)5 RefactoringStatus (org.eclipse.ltk.core.refactoring.RefactoringStatus)5 ClassInstanceCreation (org.eclipse.jdt.core.dom.ClassInstanceCreation)4 MethodDeclaration (org.eclipse.jdt.core.dom.MethodDeclaration)4