private void checkTypes( RefactoringStatus result, IMethod method, IType[] types, String key, IProgressMonitor pm) { pm.beginTask("", types.length); // $NON-NLS-1$ for (int i = 0; i < types.length; i++) { pm.worked(1); IMethod[] overridden = types[i].findMethods(method); if (overridden != null && overridden.length > 0) { result.addError( Messages.format( key, JavaElementLabels.getElementLabel(types[i], JavaElementLabels.ALL_DEFAULT)), JavaStatusContext.create(overridden[0])); } } }
private void removeNestedCalls( RefactoringStatus status, ICompilationUnit unit, ASTNode[] parents, ASTNode[] invocations, int index) { ASTNode invocation = invocations[index]; for (int i = 0; i < parents.length; i++) { ASTNode parent = parents[i]; while (parent != null) { if (parent == invocation) { status.addError( RefactoringCoreMessages.InlineMethodRefactoring_nestedInvocation, JavaStatusContext.create(unit, parent)); invocations[index] = null; } parent = parent.getParent(); } } }