Enumeration enOuter = unfilteredPersons.elements(); while (enOuter.hasMoreElements()) { Person currentOuter = (Person) enOuter.nextElement();  Enumeration enInner = unfilteredPersons.elements(); while (enInner.hasMoreElements()) { Person currentInner = (Person) enInner.nextElement(); if (currentOuter != currentInner && currentOuter.supersedes(currentInner)) redundantEntries.add(currentInner);
synchronized (unfilteredPersons) { int size = unfilteredPersons.size(); for (int i = 0; i < size; i++) { Person currentOuter = (Person) unfilteredPersons.elementAt(i); for (int j = i+1; j < size; j++) { Person currentInner = (Person) unfilteredPersons.elementAt(j); if (currentOuter.supersedes(currentInner)) { redundantEntries.add(currentInner); } else if (currentInner.supersedes(currentOuter)) { redundantEntries.add(currentOuter); } }
	public int deleteDuplicateEntries() {		Vector redundantEntries = new Vector();				Enumeration enOuter = unfilteredPersons.elements();		while (enOuter.hasMoreElements()) {			Person currentOuter = (Person) enOuter.nextElement();						Enumeration enInner = unfilteredPersons.elements();			while (enInner.hasMoreElements()) {				Person currentInner = (Person) enInner.nextElement();				if (currentOuter != currentInner && currentOuter.supersedes(currentInner))					redundantEntries.add(currentInner);			}		}				Enumeration en = redundantEntries.elements();		while (en.hasMoreElements()) {			Person p = (Person) en.nextElement();			deleteEntry(p);		}				if (redundantEntries.size() > 0) {			saveToXMLFile(JFritz.PHONEBOOK_FILE);			updateFilter();		}				return redundantEntries.size();	}