@Override public boolean visit(Name name) { StructuralPropertyDescriptor locationInParent= name.getLocationInParent(); if (locationInParent == ExpressionMethodReference.NAME_PROPERTY || locationInParent == TypeMethodReference.NAME_PROPERTY || locationInParent == SuperMethodReference.NAME_PROPERTY) { return false; } SimpleName leftmost= getLeftmost(name); IBinding leftmostBinding= leftmost.resolveBinding(); if (leftmostBinding instanceof IVariableBinding || leftmostBinding instanceof IMethodBinding || leftmostBinding instanceof ITypeBinding) { if (shouldUnqualify(leftmost)) unqualifyMemberName(leftmost); else qualifyUnqualifiedMemberNameIfNecessary(leftmost); } if (leftmostBinding instanceof ITypeBinding) { String addedImport= fNewLocationCuRewrite.getImportRewrite().addImport((ITypeBinding)leftmostBinding, fNewLocationContext); fNewLocationCuRewrite.getImportRemover().registerAddedImport(addedImport); } return false; }
private static SimpleName getMethodInvocationName(MethodReference methodReference) { SimpleName name = null; if (methodReference instanceof ExpressionMethodReference) { name = ((ExpressionMethodReference) methodReference).getName(); } else if (methodReference instanceof TypeMethodReference) { name = ((TypeMethodReference) methodReference).getName(); } else if (methodReference instanceof SuperMethodReference) { name = ((SuperMethodReference) methodReference).getName(); } return name; }
@Override public boolean visit(Name name) { StructuralPropertyDescriptor locationInParent = name.getLocationInParent(); if (locationInParent == ExpressionMethodReference.NAME_PROPERTY || locationInParent == TypeMethodReference.NAME_PROPERTY || locationInParent == SuperMethodReference.NAME_PROPERTY) { return false; } SimpleName leftmost = getLeftmost(name); IBinding leftmostBinding = leftmost.resolveBinding(); if (leftmostBinding instanceof IVariableBinding || leftmostBinding instanceof IMethodBinding || leftmostBinding instanceof ITypeBinding) { if (shouldUnqualify(leftmost)) unqualifyMemberName(leftmost); else qualifyUnqualifiedMemberNameIfNecessary(leftmost); } if (leftmostBinding instanceof ITypeBinding) { String addedImport = fNewLocationCuRewrite .getImportRewrite() .addImport((ITypeBinding) leftmostBinding, fNewLocationContext); fNewLocationCuRewrite.getImportRemover().registerAddedImport(addedImport); } return false; }
@Override public boolean visit(SuperMethodReference node) { doVisitNode(node.getQualifier()); doVisitChildren(node.typeArguments()); return false; }
@Override public boolean visit(SuperMethodReference node) { return handleMethodReference(node); }
@Override public boolean visit(SuperMethodReference node) { encounteredSuper = true; return false; }
@Override public boolean visit(SuperMethodReference node) { this.methodContainsSuperReference = true; return super.visit(node); }
@Override public boolean visit(final SuperMethodReference node) { return false; }
@Override public boolean visit(final SuperMethodReference node) { return this.visitInstrumentable(node); }
@Override public void endVisit(SuperMethodReference node) { endVisitNode(node); }
@Override public boolean visit(SuperMethodReference node) { return visitNode(node); }