@Override public final boolean isCorrect(final String word) { // synchronizing is necessary as this is called from execute Set<ISpellDictionary> copy; synchronized (fDictionaries) { copy= new HashSet<>(fDictionaries); } if (fIgnored.contains(word.toLowerCase())) return true; ISpellDictionary dictionary= null; for (final Iterator<ISpellDictionary> iterator= copy.iterator(); iterator.hasNext();) { dictionary= iterator.next(); if (dictionary.isCorrect(word)) return true; } return false; }
public final boolean isCorrect(final String word) { // synchronizing is necessary as this is called from execute Set copy; synchronized (fDictionaries) { copy= new HashSet(fDictionaries); } if (fIgnored.contains(word.toLowerCase())) return true; ISpellDictionary dictionary= null; for (final Iterator iterator= copy.iterator(); iterator.hasNext();) { dictionary= (ISpellDictionary)iterator.next(); if (dictionary.isCorrect(word)) return true; } return false; }
@Override public final boolean isCorrect(final String word) { // synchronizing is necessary as this is called from execute Set<ISpellDictionary> copy; synchronized (fDictionaries) { copy= new HashSet<>(fDictionaries); } if (fIgnored.contains(word.toLowerCase())) return true; ISpellDictionary dictionary= null; for (final Iterator<ISpellDictionary> iterator= copy.iterator(); iterator.hasNext();) { dictionary= iterator.next(); if (dictionary.isCorrect(word)) return true; } return false; }