Assert.isTrue(! visitedTypes.contains(type), RefactoringCoreMessages.getString("RippleMethodFinder.assert.contain")); Assert.isTrue(type.isInterface() || declaresAsVirtual(type, method), RefactoringCoreMessages.getString("RippleMethodFinder.assert.second"));
Assert.isTrue(! visitedTypes.contains(type), "! visitedTypes.contains(type)"); Assert.isTrue(type.isInterface() || declaresAsVirtual(type, method), "second condition");
	private static IMethod[] getAllRippleMethods(IMethod method, IProgressMonitor pm, IWorkingCopy[] workingCopies) throws JavaModelException {		pm.beginTask("", 4); //$NON-NLS-1$		Set result= new HashSet();		Set visitedTypes= new HashSet();		List methodQueue= new ArrayList();		methodQueue.add(method);		while (! methodQueue.isEmpty()){			IMethod m= (IMethod)methodQueue.remove(0);						/* must check for binary - otherwise will go all the way on all types			 * happens on toString() for example */  			if (m.isBinary())				continue; 			IType type= m.getDeclaringType();			Assert.isTrue(! visitedTypes.contains(type), RefactoringCoreMessages.getString("RippleMethodFinder.assert.contain")); //$NON-NLS-1$			Assert.isTrue(type.isInterface() || declaresAsVirtual(type, method), RefactoringCoreMessages.getString("RippleMethodFinder.assert.second")); //$NON-NLS-1$						visitedTypes.add(type);			result.add(m);						IType[] subTypes= type.newTypeHierarchy(workingCopies, new SubProgressMonitor(pm, 1)).getAllSubtypes(type);			for (int i= 0; i < subTypes.length; i++){				if (!visitedTypes.contains(subTypes[i]) && declares(subTypes[i], method)){					result.add(Checks.findMethod(m, subTypes[i]));				}				}						for (int i= 0; i < subTypes.length; i++){				IMethod toAdd= findAppropriateMethod(workingCopies, visitedTypes, methodQueue, subTypes[i], method, new NullProgressMonitor());				if (toAdd != null)					methodQueue.add(toAdd);			}		}		return (IMethod[]) result.toArray(new IMethod[result.size()]);	}