@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 boolean isTypeReferenceToInstanceMethod(MethodReference methodReference) { if (methodReference instanceof TypeMethodReference) { return true; } if (methodReference instanceof ExpressionMethodReference) { Expression expression = ((ExpressionMethodReference) methodReference).getExpression(); if (expression instanceof Name) { IBinding nameBinding = ((Name) expression).resolveBinding(); if (nameBinding != null && nameBinding instanceof ITypeBinding) { return true; } } } 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(TypeMethodReference node) { doVisitNode(node.getType()); doVisitChildren(node.typeArguments()); return false; }
@Override public boolean visit(TypeMethodReference node) { return handleMethodReference(node); }
@Override public boolean visit(final TypeMethodReference node) { return false; }
@Override public boolean visit(final TypeMethodReference node) { return this.visitInstrumentable(node); }
@Override public void endVisit(TypeMethodReference node) { endVisitNode(node); }
@Override public boolean visit(TypeMethodReference node) { return visitNode(node); }