[jsword-svn] r2054 - in trunk/jsword/src: main/java/org/crosswire/common/config main/java/org/crosswire/common/diff main/java/org/crosswire/common/options main/java/org/crosswire/common/util main/java/org/crosswire/common/xml main/java/org/crosswire/jsword/book main/java/org/crosswire/jsword/book/basic main/java/org/crosswire/jsword/book/filter main/java/org/crosswire/jsword/book/install main/java/org/crosswire/jsword/book/install/sword main/java/org/crosswire/jsword/book/readings main/java/org/crosswire/jsword/book/sword main/java/org/crosswire/jsword/bridge main/java/org/crosswire/jsword/examples main/java/org/crosswire/jsword/index/lucene main/java/org/crosswire/jsword/passage test/java/org/crosswire/common/diff

dmsmith at crosswire.org dmsmith at crosswire.org
Fri Dec 10 15:12:09 MST 2010


Author: dmsmith
Date: 2010-12-10 15:12:09 -0700 (Fri, 10 Dec 2010)
New Revision: 2054

Modified:
   trunk/jsword/src/main/java/org/crosswire/common/config/IntOptionsChoice.java
   trunk/jsword/src/main/java/org/crosswire/common/diff/Patch.java
   trunk/jsword/src/main/java/org/crosswire/common/options/OptionList.java
   trunk/jsword/src/main/java/org/crosswire/common/util/CollectionUtil.java
   trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java
   trunk/jsword/src/main/java/org/crosswire/common/util/Histogram.java
   trunk/jsword/src/main/java/org/crosswire/common/util/NetUtil.java
   trunk/jsword/src/main/java/org/crosswire/common/util/PluginUtil.java
   trunk/jsword/src/main/java/org/crosswire/common/util/Translations.java
   trunk/jsword/src/main/java/org/crosswire/common/xml/TransformingSAXEventProvider.java
   trunk/jsword/src/main/java/org/crosswire/common/xml/XMLFeatureSet.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/BookSet.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/SentenceUtil.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/FilterFactory.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/install/InstallManager.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntry.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawFileBackend.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java
   trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java
   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java
   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookExporter.java
   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookInstaller.java
   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookLookup.java
   trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java
   trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java
   trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java
   trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java
   trunk/jsword/src/main/java/org/crosswire/jsword/examples/StrongsAnalysis.java
   trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/BitwisePassage.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/DistinctPassage.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/KeyUtil.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageKeyFactory.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageTally.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/RangedPassage.java
   trunk/jsword/src/main/java/org/crosswire/jsword/passage/TreeKey.java
   trunk/jsword/src/test/java/org/crosswire/common/diff/DiffTest.java
Log:
JS-143: enhanced for loop. Done for JSword.

Modified: trunk/jsword/src/main/java/org/crosswire/common/config/IntOptionsChoice.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/config/IntOptionsChoice.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/config/IntOptionsChoice.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -103,9 +103,7 @@
         try {
             return Integer.valueOf(orig);
         } catch (NumberFormatException ex) {
-            Iterator<Map.Entry<Integer,String>> iter = options.entrySet().iterator();
-            while (iter.hasNext()) {
-                Map.Entry<Integer,String> mapEntry = iter.next();
+            for (Map.Entry<Integer,String> mapEntry : options.entrySet()) {
                 if (mapEntry.getValue().equals(orig)) {
                     return mapEntry.getKey();
                 }

Modified: trunk/jsword/src/main/java/org/crosswire/common/diff/Patch.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/diff/Patch.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/diff/Patch.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -22,7 +22,6 @@
 package org.crosswire.common.diff;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.regex.Matcher;
@@ -225,9 +224,7 @@
                     Diff diff = new Diff(text1, text2, false);
                     diffs = diff.compare();
                     index1 = 0;
-                    Iterator<Difference> diffIter = aPatch.iterator();
-                    while (diffIter.hasNext()) {
-                        Difference aDiff = diffIter.next();
+                    for (Difference aDiff : aPatch) {
                         EditType editType = aDiff.getEditType();
                         if (!EditType.EQUAL.equals(editType)) {
                             index2 = diff.xIndex(diffs, index1);

Modified: trunk/jsword/src/main/java/org/crosswire/common/options/OptionList.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/options/OptionList.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/options/OptionList.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -23,7 +23,6 @@
 package org.crosswire.common.options;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -80,9 +79,7 @@
             matches.add(longOptions.get(key));
         }
 
-        Iterator<Map.Entry<String, Option>> iter = longOptions.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry<String, Option> entry = iter.next();
+        for (Map.Entry<String,Option> entry : longOptions.entrySet()) {
             String entryKey = entry.getKey();
             Option entryValue = entry.getValue();
             if (entryKey.startsWith(key) && !matches.contains(entryValue)) {

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/CollectionUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/CollectionUtil.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/CollectionUtil.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -27,7 +27,6 @@
 import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/Convert.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -21,8 +21,6 @@
  */
 package org.crosswire.common.util;
 
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 /**
@@ -189,12 +187,8 @@
      * @return the converted data
      */
     public static String map2String(Map<Object,Object> commands) {
-        Iterator<Map.Entry<Object,Object>> it = commands.entrySet().iterator();
         StringBuilder retcode = new StringBuilder();
-
-        while (it.hasNext()) {
-            Map.Entry<Object,Object> entry = it.next();
-
+        for (Map.Entry<Object,Object> entry : commands.entrySet()) {
             retcode.append(entry.getKey());
             retcode.append('=');
             retcode.append(entry.getValue());

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/Histogram.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/Histogram.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/Histogram.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -22,7 +22,6 @@
 package org.crosswire.common.util;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 /**
@@ -69,10 +68,8 @@
     @Override
     public String toString() {
         StringBuilder buf = new StringBuilder();
-        Iterator<Map.Entry<String,Counter>> iter = hist.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry<String,Counter> entry = iter.next();
-            buf.append(entry.getKey().toString());
+        for (Map.Entry<String,Counter> entry : hist.entrySet()) {
+            buf.append(entry.getKey());
             buf.append('\t');
             buf.append(entry.getValue().toString());
             buf.append('\n');

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/NetUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/NetUtil.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/NetUtil.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -40,8 +40,6 @@
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
-import java.util.Properties;
 import java.util.jar.JarEntry;
 
 /**

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/PluginUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/PluginUtil.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/PluginUtil.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -26,7 +26,6 @@
 import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.MissingResourceException;
@@ -101,10 +100,8 @@
 
         try {
             PropertyMap props = getPlugin(clazz);
-            Iterator<String> it = props.keySet().iterator();
-            while (it.hasNext()) {
+            for (String key : props.keySet()) {
                 try {
-                    String key = it.next();
                     String value = props.get(key);
                     Class<T> impl = (Class<T>) ClassUtil.forName(value);
                     if (clazz.isAssignableFrom(impl)) {

Modified: trunk/jsword/src/main/java/org/crosswire/common/util/Translations.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/util/Translations.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/util/Translations.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -24,7 +24,6 @@
 import java.io.IOException;
 import java.net.URI;
 import java.net.URL;
-import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
 

Modified: trunk/jsword/src/main/java/org/crosswire/common/xml/TransformingSAXEventProvider.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/xml/TransformingSAXEventProvider.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/xml/TransformingSAXEventProvider.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -25,7 +25,6 @@
 import java.io.InputStream;
 import java.net.URI;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
 
@@ -134,16 +133,13 @@
 
         Transformer transformer = tinfo.getTemplates().newTransformer();
 
-        Iterator<Object> iter = outputs.keySet().iterator();
-        while (iter.hasNext()) {
-            String key = (String) iter.next();
+        for (Object obj : outputs.keySet()) {
+            String key = (String) obj;
             String val = getOutputProperty(key);
             transformer.setOutputProperty(key, val);
         }
 
-        Iterator<String> iter2 = params.keySet().iterator();
-        while (iter2.hasNext()) {
-            String key = iter2.next();
+        for (String key : params.keySet()) {
             Object val = params.get(key);
             transformer.setParameter(key, val);
         }

Modified: trunk/jsword/src/main/java/org/crosswire/common/xml/XMLFeatureSet.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/common/xml/XMLFeatureSet.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/common/xml/XMLFeatureSet.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -42,7 +42,6 @@
  */
 package org.crosswire.common.xml;
 
-import java.util.Iterator;
 import java.util.Locale;
 import java.util.Map;
 import java.util.TreeMap;
@@ -73,9 +72,7 @@
         features.put("xb", new XMLFeatureState(XMLFeature.XINCLUDE_FIXUP_BASE_URIS, true));
         features.put("xl", new XMLFeatureState(XMLFeature.XINCLUDE_FIXUP_LANGUAGE, true));
 
-        Iterator<Map.Entry<String,XMLFeatureState>> iter = features.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry<String,XMLFeatureState> entry = iter.next();
+        for (Map.Entry<String,XMLFeatureState> entry : features.entrySet()) {
             states.put(entry.getValue().getFeature(), entry.getKey());
         }
     }
@@ -108,9 +105,7 @@
     public String toString() {
         StringBuilder buf = new StringBuilder();
         buf.append('\n');
-        Iterator<XMLFeatureState> iter = features.values().iterator();
-        while (iter.hasNext()) {
-            XMLFeatureState state = iter.next();
+        for (XMLFeatureState state : features.values()) {
             buf.append(state.getFeature().toString()).append('\n');
         }
         return buf.toString();
@@ -142,9 +137,7 @@
     }
 
     public void setFeatures(XMLReader parser) {
-        Iterator<XMLFeatureState> iter = features.values().iterator();
-        while (iter.hasNext()) {
-            XMLFeatureState state = iter.next();
+        for (XMLFeatureState state : features.values()) {
             state.setFeature(parser);
         }
     }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/BookSet.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/BookSet.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/BookSet.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -73,9 +73,7 @@
      */
     public Set<Object> getGroup(String key) {
         Set<Object> results = new TreeSet<Object>();
-        Iterator<Book> iter = iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : this) {
             Object property = book.getProperty(key);
             if (property != null) {
                 results.add(property);
@@ -127,9 +125,7 @@
         // and then sort the list.
         // This can be revisited if the list performs badly.
         boolean added = false;
-        Iterator<? extends Book> iter = c.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : c) {
             if (add(book)) {
                 added = true;
             }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Books.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -25,7 +25,6 @@
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
@@ -89,18 +88,14 @@
 
         // Check name first
         // First check for exact matches
-        Iterator<Book> iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : books) {
             if (name.equals(book.getName())) {
                 return book;
             }
         }
 
         // Next check for case-insensitive matches
-        iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : books) {
             if (name.equalsIgnoreCase(book.getName())) {
                 return book;
             }
@@ -108,9 +103,7 @@
 
         // Then check initials
         // First check for exact matches
-        iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : books) {
             BookMetaData bmd = book.getBookMetaData();
             if (name.equals(bmd.getInitials())) {
                 return book;
@@ -118,9 +111,7 @@
         }
 
         // Next check for case-insensitive matches
-        iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : books) {
             if (name.equalsIgnoreCase(book.getInitials())) {
                 return book;
             }
@@ -149,10 +140,7 @@
      */
     public int getMaxLength(String propertyKey) {
         int max = -1;
-        List<Book> bookList = getBooks();
-        Iterator<Book> iter = bookList.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : getBooks()) {
             Object property = book.getProperty(propertyKey);
             if (property != null) {
                 String value = property instanceof String ? (String) property : property.toString();
@@ -173,10 +161,7 @@
      */
     public int getMaxLength(String propertyKey, BookFilter filter) {
         int max = -1;
-        List<Book> bookList = getBooks(filter);
-        Iterator<Book> iter = bookList.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : getBooks(filter)) {
             Object property = book.getProperty(propertyKey);
             if (property != null) {
                 String value = property instanceof String ? (String) property : property.toString();
@@ -300,9 +285,7 @@
 
         // Remove the books from the previous version of the driver
         // that are not in this version.
-        Iterator<Book> iter = current.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : current) {
             removeBook(book);
         }
 
@@ -339,9 +322,7 @@
      */
     public synchronized BookDriver[] getDriversByClass(Class<? extends BookDriver> type) {
         List<BookDriver> matches = new ArrayList<BookDriver>();
-        Iterator<BookDriver> iter = drivers.iterator();
-        while (iter.hasNext()) {
-            BookDriver driver = iter.next();
+        for (BookDriver driver : drivers) {
             if (driver.getClass() == type) {
                 matches.add(driver);
             }
@@ -366,9 +347,7 @@
      */
     public synchronized BookDriver[] getWritableDrivers() {
         int i = 0;
-        Iterator<BookDriver> iter = drivers.iterator();
-        while (iter.hasNext()) {
-            BookDriver driver = iter.next();
+        for (BookDriver driver : drivers) {
             if (driver.isWritable()) {
                 i++;
             }
@@ -377,9 +356,7 @@
         BookDriver[] reply = new BookDriver[i];
 
         i = 0;
-        iter = drivers.iterator();
-        while (iter.hasNext()) {
-            BookDriver driver = iter.next();
+        for (BookDriver driver : drivers) {
             if (driver.isWritable()) {
                 reply[i++] = driver;
             }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/DefaultBook.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -126,9 +126,7 @@
             return;
         }
 
-        Iterator<Book> iter = books.getBooks(filter).iterator();
-        while (iter.hasNext()) {
-            Book aBook = iter.next();
+        for (Book aBook : books.getBooks(filter)) {
             if (aBook.match(name)) {
                 setDefault(aBook);
                 return;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/Defaults.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -21,7 +21,6 @@
  */
 package org.crosswire.jsword.book;
 
-import java.util.Iterator;
 import java.util.Map;
 import java.util.TreeMap;
 
@@ -539,9 +538,7 @@
      * the current defaults with one of these.
      */
     protected static void checkAllPreferable() {
-        Iterator<Book> iter = Books.installed().getBooks().iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : Books.installed().getBooks()) {
             checkPreferable(book);
         }
     }
@@ -569,9 +566,7 @@
     private static Map<Book,String> getBookMap(BookFilter filter) {
         Map<Book,String> books = new TreeMap<Book,String>(BookComparators.getDefault());
 
-        Iterator<Book> iter = Books.installed().getBooks(filter).iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : Books.installed().getBooks(filter)) {
             books.put(book, book.getName());
         }
 

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/OSISUtil.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -698,9 +698,8 @@
     public static String getStrongsNumbers(Element root) {
         StringBuilder buffer = new StringBuilder();
 
-        Iterator<Content> contentIter = getDeepContent(root, OSISUtil.OSIS_ELEMENT_W).iterator();
-        while (contentIter.hasNext()) {
-            Element ele = (Element) contentIter.next();
+        for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_TITLE)) {
+            Element ele = (Element) content;
             String attr = ele.getAttributeValue(OSISUtil.ATTRIBUTE_W_LEMMA);
             if (attr != null) {
                 Matcher matcher = strongsNumberPattern.matcher(attr);
@@ -726,9 +725,8 @@
         KeyFactory keyf = PassageKeyFactory.instance();
         Key collector = keyf.createEmptyKeyList();
 
-        Iterator<Content> contentIter = getDeepContent(root, OSISUtil.OSIS_ELEMENT_REFERENCE).iterator();
-        while (contentIter.hasNext()) {
-            Element ele = (Element) contentIter.next();
+        for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_TITLE)) {
+            Element ele = (Element) content;
             String attr = ele.getAttributeValue(OSISUtil.OSIS_ATTR_REF);
             if (attr != null) {
                 try {
@@ -751,9 +749,8 @@
     public static String getNotes(Element root) {
         StringBuilder buffer = new StringBuilder();
 
-        Iterator<Content> contentIter = getDeepContent(root, OSISUtil.OSIS_ELEMENT_NOTE).iterator();
-        while (contentIter.hasNext()) {
-            Element ele = (Element) contentIter.next();
+        for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_TITLE)) {
+            Element ele = (Element) content;
             String attr = ele.getAttributeValue(OSISUtil.OSIS_ATTR_TYPE);
             if (attr == null || !attr.equals(NOTETYPE_REFERENCE)) {
                 if (buffer.length() > 0) {
@@ -774,9 +771,8 @@
     public static String getHeadings(Element root) {
         StringBuilder buffer = new StringBuilder();
 
-        Iterator<Content> contentIter = getDeepContent(root, OSISUtil.OSIS_ELEMENT_TITLE).iterator();
-        while (contentIter.hasNext()) {
-            Element ele = (Element) contentIter.next();
+        for (Content content : getDeepContent(root, OSISUtil.OSIS_ELEMENT_TITLE)) {
+            Element ele = (Element) content;
             getCanonicalContent(ele, null, ele.getContent().iterator(), buffer);
         }
 
@@ -839,9 +835,7 @@
     private static String getTextContent(List<Content> fragment) {
         StringBuilder buffer = new StringBuilder();
 
-        Iterator<Content> contentIter = fragment.iterator();
-        while (contentIter.hasNext()) {
-            Content next = contentIter.next();
+        for (Content next : fragment) {
             recurseElement(next, buffer);
         }
 
@@ -1104,11 +1098,9 @@
             reply.add(start);
         }
 
-        Content data = null;
+//        Content data = null;
         Element ele = null;
-        Iterator<Content> contentIter = start.getContent().iterator();
-        while (contentIter.hasNext()) {
-            data = contentIter.next();
+        for (Content data : (List<Content>) start.getContent()) {
             if (data instanceof Element) {
                 ele = (Element) data;
                 recurseDeepContent(ele, name, reply);
@@ -1140,9 +1132,7 @@
      */
     private static void recurseChildren(Element ele, StringBuilder buffer) {
         // ele is a JDOM Element that might have a getContent() method
-        Iterator<Content> contentIter = ele.getContent().iterator();
-        while (contentIter.hasNext()) {
-            Content sub = contentIter.next();
+        for (Content sub : (List<Content>) ele.getContent()) {
             recurseElement(sub, buffer);
         }
     }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/SentenceUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/SentenceUtil.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/SentenceUtil.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -22,7 +22,6 @@
 package org.crosswire.jsword.book;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 
@@ -100,9 +99,8 @@
         // Create a String[]
         String[] retcode = new String[tokens.size()];
         int i = 0;
-        Iterator<String> iter = tokens.iterator();
-        while (iter.hasNext()) {
-            retcode[i++] = iter.next();
+        for (String token : tokens) {
+            retcode[i++] = token;
         }
 
         return retcode;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/basic/AbstractPassageBook.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -82,9 +82,7 @@
                 }
 
                 // For all the verses in this range
-                Iterator<Key> vit = range.iterator();
-                while (vit.hasNext()) {
-                    Key verse = vit.next();
+                for (Key verse : range) {
                     String txt = getRawText(verse);
 
                     // If the verse is empty then we shouldn't add the verse tag
@@ -148,16 +146,12 @@
      */
     public void setDocument(Key key, BookData bdata) throws BookException {
         // For all of the sections
-        Iterator<?> sit = OSISUtil.getFragment(bdata.getOsisFragment()).iterator();
-        while (sit.hasNext()) {
-            Object nextElem = sit.next();
+        for (Content nextElem : OSISUtil.getFragment(bdata.getOsisFragment())) {
             if (nextElem instanceof Element) {
                 Element div = (Element) nextElem;
 
                 // For all of the Verses in the section
-                Iterator<Object> vit = div.getContent().iterator();
-                while (vit.hasNext()) {
-                    Object data = vit.next();
+                for (Content data : (List<Content>) div.getContent()) {
                     if (data instanceof Element) {
                         Element overse = (Element) data;
                         String text = OSISUtil.getPlainText(overse);
@@ -200,9 +194,7 @@
         if (global == null) {
             global = keyf.createEmptyKeyList();
             Key all = keyf.getGlobalKeyList();
-            Iterator<Key> iter = all.iterator();
-            while (iter.hasNext()) {
-                Key key = iter.next();
+            for (Key key : all) {
                 if (contains(key)) {
                     global.addAll(key);
                 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/FilterFactory.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/FilterFactory.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/filter/FilterFactory.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -22,7 +22,6 @@
 package org.crosswire.jsword.book.filter;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Locale;
 import java.util.Map;
 
@@ -76,11 +75,9 @@
         }
 
         // the lookup table
-        Iterator<Map.Entry<String,Class<Filter>>> it = map.entrySet().iterator();
         Filter instance = null;
-        while (it.hasNext()) {
+        for (Map.Entry<String,Class<Filter>> entry : map.entrySet()) {
             try {
-                Map.Entry<String,Class<Filter>> entry = it.next();
                 Class<Filter> clazz = entry.getValue();
                 instance = clazz.newInstance();
                 addFilter(entry.getKey(), instance);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/install/InstallManager.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/install/InstallManager.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/install/InstallManager.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -125,10 +125,7 @@
      */
     public String getFactoryNameForInstaller(Installer installer) {
         Class<? extends Installer> match = installer.getClass();
-
-        Iterator<String> it = factories.keySet().iterator();
-        while (it.hasNext()) {
-            String name = it.next();
+        for (String name : factories.keySet()) {
             Class<InstallerFactory> factclazz = factories.get(name);
             try {
                 InstallerFactory ifactory = factclazz.newInstance();
@@ -153,9 +150,7 @@
      * looking!
      */
     public String getInstallerNameForInstaller(Installer installer) {
-        Iterator<String> it = installers.keySet().iterator();
-        while (it.hasNext()) {
-            String name = it.next();
+        for (String name : installers.keySet()) {
             Installer test = installers.get(name);
             if (installer.equals(test)) {
                 return name;
@@ -163,9 +158,7 @@
         }
 
         log.warn("Failed to find installer name for " + installer.toString() + " among the " + installers.size() + " installers.");
-        it = installers.keySet().iterator();
-        while (it.hasNext()) {
-            String name = it.next();
+        for (String name : installers.keySet()) {
             Installer test = installers.get(name);
             log.warn("  it isn't equal to " + test.getInstallerDefinition());
         }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/install/sword/AbstractSwordInstaller.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -27,7 +27,6 @@
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.zip.GZIPInputStream;
@@ -159,19 +158,14 @@
     public synchronized Book getBook(String name) {
         // Check name first
         // First check for exact matches
-        List<Book> books = getBooks();
-        Iterator<Book> iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : getBooks()) {
             if (name.equals(book.getName())) {
                 return book;
             }
         }
 
         // Next check for case-insensitive matches
-        iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : getBooks()) {
             if (name.equalsIgnoreCase(book.getName())) {
                 return book;
             }
@@ -179,9 +173,7 @@
 
         // Then check initials
         // First check for exact matches
-        iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : getBooks()) {
             BookMetaData bmd = book.getBookMetaData();
             if (name.equals(bmd.getInitials())) {
                 return book;
@@ -189,9 +181,7 @@
         }
 
         // Next check for case-insensitive matches
-        iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : getBooks()) {
             if (name.equalsIgnoreCase(book.getInitials())) {
                 return book;
             }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/readings/ReadingsBook.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -49,7 +49,6 @@
 import org.crosswire.jsword.passage.PreferredKey;
 import org.crosswire.jsword.passage.RestrictionType;
 import org.crosswire.jsword.passage.SetKeyList;
-import org.crosswire.jsword.passage.VerseRange;
 import org.jdom.Content;
 import org.jdom.Element;
 
@@ -149,7 +148,7 @@
 
             Iterator<Key> it = ref.rangeIterator(RestrictionType.NONE);
             while (it.hasNext()) {
-                VerseRange range = (VerseRange) it.next();
+                Key range = it.next();
 
                 Element reading = OSISUtil.factory().createReference();
                 reading.setAttribute(OSISUtil.OSIS_ATTR_REF, range.getOsisRef());

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntry.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntry.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntry.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -22,7 +22,6 @@
 package org.crosswire.jsword.book.sword;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.regex.Pattern;
 
@@ -277,9 +276,7 @@
             Element listEle = factory.createLG();
             valueElement.addContent(listEle);
 
-            Iterator<String> iter = values.iterator();
-            while (iter.hasNext()) {
-                String text = iter.next();
+            for (String text : values) {
                 text = XMLUtil.escape(text);
                 Element itemEle = factory.createL();
                 listEle.addContent(itemEle);
@@ -376,20 +373,17 @@
             // followed by a space.
             // These are to joined to the key.
             if (type.equals(ConfigEntryType.HISTORY)) {
-                Iterator<String> iter = values.iterator();
-                while (iter.hasNext()) {
-                    String text = iter.next();
+                for (String text : values) {
                     buf.append(getName());
                     buf.append('_');
                     buf.append(text.replaceFirst(" ", "="));
                     buf.append('\n');
                 }
             } else {
-                Iterator<String> iter = values.iterator();
-                while (iter.hasNext()) {
+                for (String text : values) {
                     buf.append(getName());
                     buf.append('=');
-                    buf.append(getConfValue(iter.next()));
+                    buf.append(getConfValue(text));
                     buf.append('\n');
                 }
             }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/ConfigEntryTable.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -31,7 +31,6 @@
 import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
@@ -728,9 +727,7 @@
      */
     private void toOSIS(OSISUtil.OSISFactory factory, Element ele, String aTitle, Map<String,ConfigEntry> map) {
         Element title = null;
-        Iterator<Map.Entry<String,ConfigEntry>> iter = map.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry<String,ConfigEntry> mapEntry = iter.next();
+        for (Map.Entry<String,ConfigEntry> mapEntry : map.entrySet()) {
             ConfigEntry entry = mapEntry.getValue();
             Element configElement = null;
 
@@ -752,9 +749,7 @@
     }
 
     private void toConf(StringBuilder buf, Map<String,ConfigEntry> map) {
-        Iterator<Map.Entry<String,ConfigEntry>> iter = map.entrySet().iterator();
-        while (iter.hasNext()) {
-            Map.Entry<String,ConfigEntry> mapEntry = iter.next();
+        for (Map.Entry<String,ConfigEntry> mapEntry : map.entrySet()) {
             ConfigEntry entry = mapEntry.getValue();
             String text = entry.toConf();
             if (text != null && text.length() > 0) {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawFileBackend.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawFileBackend.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/RawFileBackend.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -28,8 +28,6 @@
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.text.DecimalFormat;
-
 import org.crosswire.common.util.Logger;
 import org.crosswire.jsword.book.BookException;
 import org.crosswire.jsword.passage.Key;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBook.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBook.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -22,7 +22,6 @@
 package org.crosswire.jsword.book.sword;
 
 import java.io.IOException;
-import java.util.Iterator;
 import java.util.List;
 
 import org.crosswire.common.activate.Activator;
@@ -120,9 +119,7 @@
     public void addOSIS(Key key, Element div, List<Content> osisContent) {
         // See if the text is marked up with verses
         // If it is then just add it.
-        Iterator<Content> iter = osisContent.iterator();
-        while (iter.hasNext()) {
-            Content content = iter.next();
+        for (Content content : osisContent) {
             if (content instanceof Element) {
                 Element ele = (Element) content;
                 if (ele.getName().equals(OSISUtil.OSIS_ELEMENT_VERSE)) {
@@ -144,9 +141,7 @@
     public void addOSIS(Key key, List<Content> contentList, List<Content> osisContent) {
         // See if the text is marked up with verses
         // If it is then just add it.
-        Iterator<Content> iter = osisContent.iterator();
-        while (iter.hasNext()) {
-            Content content = iter.next();
+        for (Content content : osisContent) {
             if (content instanceof Element) {
                 Element ele = (Element) content;
                 if (ele.getName().equals(OSISUtil.OSIS_ELEMENT_VERSE)) {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordBookMetaData.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -24,7 +24,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URI;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 
@@ -329,9 +328,7 @@
 
     private void buildProperties() {
         // merge entries into properties file
-        Iterator<ConfigEntryType> iter = cet.getKeys().iterator();
-        while (iter.hasNext()) {
-            ConfigEntryType key = iter.next();
+        for (ConfigEntryType key : cet.getKeys()) {
             Object value = cet.getValue(key);
             // value is null if the config entry was rejected.
             if (value == null) {
@@ -341,9 +338,7 @@
                 List<String> list = (List<String>) value;
                 StringBuilder combined = new StringBuilder();
                 boolean appendSeparator = false;
-                Iterator<String> it = list.iterator();
-                while (it.hasNext()) {
-                    String element = it.next();
+                for (String element : list) {
                     if (appendSeparator) {
                         combined.append('\n');
                     }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/book/sword/SwordGenBook.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -76,9 +76,7 @@
         set = backend.readIndex();
 
         map = new HashMap<String,Key>();
-        Iterator<Key> iter = set.iterator();
-        while (iter.hasNext()) {
-            Key key = iter.next();
+        for (Key key : set) {
             map.put(key.getName(), key);
         }
 
@@ -232,27 +230,21 @@
         }
 
         // First check for keys that match ignoring case
-        Iterator<String> iter = map.keySet().iterator();
-        while (iter.hasNext()) {
-            String keyName = iter.next();
+        for (String keyName : map.keySet()) {
             if (keyName.equalsIgnoreCase(text)) {
                 return map.get(keyName);
             }
         }
 
         // Next keys that start with the given text
-        iter = map.keySet().iterator();
-        while (iter.hasNext()) {
-            String keyName = iter.next();
+        for (String keyName : map.keySet()) {
             if (keyName.startsWith(text)) {
                 return map.get(keyName);
             }
         }
 
         // Next try keys that contain the given text
-        iter = map.keySet().iterator();
-        while (iter.hasNext()) {
-            String keyName = iter.next();
+        for (String keyName : map.keySet()) {
             if (keyName.indexOf(text) != -1) {
                 return map.get(keyName);
             }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BibleScope.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -21,8 +21,6 @@
  */
 package org.crosswire.jsword.bridge;
 
-import java.util.Iterator;
-
 import org.crosswire.jsword.book.Book;
 import org.crosswire.jsword.book.BookCategory;
 import org.crosswire.jsword.book.Books;
@@ -71,9 +69,7 @@
             Key all = keyf.getGlobalKeyList();
             inScope = keyf.createEmptyKeyList();
             outScope = keyf.createEmptyKeyList();
-            Iterator<Key> iter = all.iterator();
-            while (iter.hasNext()) {
-                Key key = iter.next();
+            for (Key key : all) {
                 if (book.contains(key)) {
                     inScope.addAll(key);
                 } else {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookExporter.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookExporter.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookExporter.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -21,8 +21,6 @@
  */
 package org.crosswire.jsword.bridge;
 
-import java.util.Iterator;
-
 import org.crosswire.jsword.book.Book;
 import org.crosswire.jsword.book.BookCategory;
 import org.crosswire.jsword.book.BookException;
@@ -52,10 +50,8 @@
 
         Key keys = book.getGlobalKeyList();
 
-        Iterator<Key> iter = keys.iterator();
         StringBuilder buf = new StringBuilder();
-        while (iter.hasNext()) {
-            Key key = iter.next();
+        for (Key key : keys) {
             String rawText = book.getRawText(key);
             if (rawText != null && rawText.trim().length() > 0) {
                 buf.delete(0, buf.length());

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookInstaller.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookInstaller.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookInstaller.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -21,7 +21,6 @@
  */
 package org.crosswire.jsword.bridge;
 
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -290,21 +289,16 @@
         } else if (operation.equalsIgnoreCase("sources")) {
             // Get all the installers one after the other
             Map<String,Installer> installers = installer.getInstallers();
-            Iterator<String> iter = installers.keySet().iterator();
-            while (iter.hasNext()) {
-                System.out.println(iter.next());
+            for (String name : installers.keySet()) {
+                System.out.println(name);
             }
         } else if (operation.equalsIgnoreCase("list")) {
             if (args.length == 1) {
-                Iterator<Book> iter = BookInstaller.getInstalledBooks().iterator();
-                while (iter.hasNext()) {
-                    Book book = iter.next();
+                for (Book book : BookInstaller.getInstalledBooks()) {
                     System.out.println(book.getInitials());
                 }
             } else if (args.length == 2) {
-                Iterator<Book> iter = installer.getRepositoryBooks(args[1]).iterator();
-                while (iter.hasNext()) {
-                    Book book = iter.next();
+                for (Book book : installer.getRepositoryBooks(args[1])) {
                     System.out.println(book.getInitials());
                 }
             } else {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookLookup.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookLookup.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/bridge/BookLookup.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -21,8 +21,6 @@
  */
 package org.crosswire.jsword.bridge;
 
-import java.util.Iterator;
-
 import org.crosswire.jsword.book.Book;
 import org.crosswire.jsword.book.BookException;
 import org.crosswire.jsword.book.Books;
@@ -46,9 +44,7 @@
     public String locate(Key key) throws BookException {
         StringBuilder buf = new StringBuilder();
 
-        Iterator<Key> iter = key.iterator();
-        while (iter.hasNext()) {
-            Key currentKey = iter.next();
+        for (Key currentKey: key) {
             String osisID = currentKey.getOsisID();
             if (buf.length() > 0) {
                 buf.append('\n');

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/bridge/DwrBridge.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -23,7 +23,6 @@
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 
@@ -61,11 +60,7 @@
     public String[][] getInstalledBooks(String filter) {
         List<String[]> reply = new ArrayList<String[]>();
 
-        List<Book> books = BookInstaller.getInstalledBooks(filter);
-
-        Iterator<Book> iter = books.iterator();
-        while (iter.hasNext()) {
-            Book book = iter.next();
+        for (Book book : BookInstaller.getInstalledBooks(filter)) {
             String[] rbook = new String[] {
                     book.getInitials(), book.getName()
             };
@@ -184,10 +179,8 @@
         // What is needed is that all this be pushed into JSword proper.
         // TODO(dms): Push this into Book interface.
         List<String> result = new ArrayList<String>();
-        Iterator<Key> iter = book.getGlobalKeyList().iterator();
         int count = 0;
-        while (iter.hasNext()) {
-            Key key = iter.next();
+        for (Key key : book.getGlobalKeyList()) {
             String entry = key.getName().toLowerCase(sortLocale);
             if (entry.compareTo(target) >= 0) {
                 if (entry.compareTo(endTarget) < 0) {
@@ -276,20 +269,17 @@
 
             // Do we need to trim?
             if (start > 0 || key.getCardinality() > count) {
-                Iterator<Key> iter = key.iterator();
                 key = book.createEmptyKeyList();
                 int i = 0;
-                while (iter.hasNext()) {
+                for (Key aKey : key) {
                     i++;
                     if (i <= start) {
-                        // skip it
-                        iter.next();
                         continue;
                     }
                     if (i >= count) {
                         break;
                     }
-                    key.addAll(iter.next());
+                    key.addAll(aKey);
                 }
             }
         }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/APIExamples.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -126,13 +126,12 @@
         } else {
             key = book.createEmptyKeyList();
 
-            Iterator<Key> iter = book.getKey(reference).iterator();
             int count = 0;
-            while (iter.hasNext()) {
+            for (Key aKey : book.getKey(reference)) {
                 if (++count >= maxKeyCount) {
                     break;
                 }
-                key.addAll(iter.next());
+                key.addAll(aKey);
             }
         }
 
@@ -340,10 +339,8 @@
         Map<String,Installer> installers = imanager.getInstallers();
 
         // Get all the installers one after the other
-        Iterator<Map.Entry<String,Installer>> iter = installers.entrySet().iterator();
         String name = null;
-        while (iter.hasNext()) {
-            Map.Entry<String,Installer> mapEntry = iter.next();
+        for (Map.Entry<String,Installer> mapEntry : installers.entrySet()) {
             name = mapEntry.getKey();
             installer = mapEntry.getValue();
             System.out.println(name + ": " + installer.getInstallerDefinition());

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/BibleToOsis.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -27,7 +27,6 @@
 import java.io.Writer;
 import java.text.FieldPosition;
 import java.text.MessageFormat;
-import java.util.Iterator;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -85,9 +84,8 @@
         }
 
         // Get a verse iterator
-        Iterator<Key> iter = keys.iterator();
-        while (iter.hasNext()) {
-            Verse verse = (Verse) iter.next();
+        for (Key key : keys) {
+            Verse verse = (Verse) key;
             String raw = bible.getRawText(verse);
             String osisID = verse.getOsisID();
             String currentBookName = BibleInfo.getOSISName(verse.getBook());

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/DictToOsis.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -27,8 +27,6 @@
 import java.io.Writer;
 import java.text.FieldPosition;
 import java.text.MessageFormat;
-import java.util.Iterator;
-
 import org.crosswire.common.xml.SAXEventProvider;
 import org.crosswire.common.xml.XMLProcess;
 import org.crosswire.common.xml.XMLUtil;
@@ -71,9 +69,7 @@
         buildDocumentOpen(buf, bmd);
 
         // Get a verse iterator
-        Iterator<Key> iter = keys.iterator();
-        while (iter.hasNext()) {
-            Key key = iter.next();
+        for (Key key : keys) {
             BookData bdata = new BookData(book, key);
             SAXEventProvider osissep = bdata.getSAXEventProvider();
             try {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/examples/StrongsAnalysis.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/examples/StrongsAnalysis.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/examples/StrongsAnalysis.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -22,8 +22,6 @@
 package org.crosswire.jsword.examples;
 
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
@@ -79,13 +77,10 @@
      * @param wholeBible
      */
     public void analyze(StrongsMapSet sms, Book book, List<Key> errors, Key wholeBible) {
-        Key subkey = null;
         BookData data = null;
         Element osis = null;
         StringBuilder buffer = new StringBuilder();
-        Iterator<Key> it = wholeBible.iterator();
-        while (it.hasNext()) {
-            subkey = it.next();
+        for (Key subkey : wholeBible) {
             if (subkey.canHaveChildren()) {
                 analyze(sms, book, errors, subkey);
             } else {
@@ -100,19 +95,17 @@
                 }
 
                 // Do the actual indexing
-                Collection<Content> allW = OSISUtil.getDeepContent(osis, OSISUtil.OSIS_ELEMENT_W);
-                Iterator<Content> wIter = allW.iterator();
-                while (wIter.hasNext()) {
+                for (Content content : OSISUtil.getDeepContent(osis, OSISUtil.OSIS_ELEMENT_W)) {
                     // Clear out the buffer for re-use
                     int len = buffer.length();
                     if (len > 0) {
                         buffer.delete(0, len);
                     }
 
-                    Element wElement = (Element) wIter.next();
+                    Element wElement = (Element) content;
                     String snAttr = wElement.getAttributeValue(OSISUtil.ATTRIBUTE_W_LEMMA);
 
-                    String content = OSISUtil.getPlainText(wElement);
+                    String text = OSISUtil.getPlainText(wElement);
 
                     Matcher matcher = strongsNumberPattern.matcher(snAttr);
                     while (matcher.find()) {
@@ -129,7 +122,7 @@
                     }
 
                     // now we can actually store the mapping
-                    sms.add(buffer.toString(), content);
+                    sms.add(buffer.toString(), text);
                 }
             }
         }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/index/lucene/LuceneIndex.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -25,7 +25,6 @@
 import java.io.IOException;
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.lucene.analysis.Analyzer;
@@ -212,9 +211,8 @@
 
                 if (!errors.isEmpty()) {
                     StringBuilder buf = new StringBuilder();
-                    Iterator<Key> iter = errors.iterator();
-                    while (iter.hasNext()) {
-                        buf.append(iter.next());
+                    for (Key error : errors) {
+                        buf.append(error);
                         buf.append('\n');
                     }
                     // TRANSLATOR: It is likely that one or more verses could not be indexed due to errors in those verses.
@@ -393,7 +391,6 @@
         int percent = 0;
         String rootName = "";
         BookData data = null;
-        Key subkey = null;
         Element osis = null;
 
         // Set up for reuse.
@@ -407,9 +404,7 @@
 
         int size = key.getCardinality();
         int subCount = count;
-        Iterator<Key> it = key.iterator();
-        while (it.hasNext()) {
-            subkey = it.next();
+        for (Key subkey : key) {
             if (subkey.canHaveChildren()) {
                 generateSearchIndexImpl(job, errors, writer, subkey, subCount);
             } else {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/AbstractPassage.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -369,9 +369,8 @@
         int current_book = 0;
         int book_count = 0;
 
-        Iterator<Key> it = iterator();
-        while (it.hasNext()) {
-            Verse verse = (Verse) it.next();
+        for (Key aKey : this) {
+            Verse verse = (Verse) aKey;
             if (current_book != verse.getBook()) {
                 current_book = verse.getBook();
                 book_count++;
@@ -394,9 +393,8 @@
         int current_chapter = 0;
         int chapter_count = 0;
 
-        Iterator<Key> it = iterator();
-        while (it.hasNext()) {
-            Verse verse = (Verse) it.next();
+        for (Key aKey : this) {
+            Verse verse = (Verse) aKey;
 
             if ((book == 0 || verse.getBook() == book) && current_chapter != verse.getChapter()) {
                 current_chapter = verse.getChapter();
@@ -417,9 +415,8 @@
 
         int verse_count = 0;
 
-        Iterator<Key> it = iterator();
-        while (it.hasNext()) {
-            Verse verse = (Verse) it.next();
+        for (Key aKey : this) {
+            Verse verse = (Verse) aKey;
 
             if ((book == 0 || verse.getBook() == book) && (chapter == 0 || verse.getChapter() == chapter)) {
                 verse_count++;
@@ -523,11 +520,8 @@
 
         Passage remainder = (Passage) this.clone();
 
-        Iterator<Key> it = iterator();
-        while (it.hasNext()) {
+        for (Key verse : this) {
             i++;
-            Key verse = it.next();
-
             if (i > count) {
                 remove(verse);
                 overflow = true;
@@ -599,15 +593,16 @@
 
         if (that instanceof RangedPassage) {
             that_it = that.rangeIterator(RestrictionType.NONE);
+            while (that_it.hasNext()) {
+                // Avoid touching store to make thread safety easier.
+                add((Key) that_it.next());
+            }
         } else {
-            that_it = that.iterator();
+            for (Key subkey : that) {
+                add(subkey);
+            }
         }
 
-        while (that_it.hasNext()) {
-            // Avoid touching store to make thread safety easier.
-            add((Key) that_it.next());
-        }
-
         lowerNormalizeProtection();
         if (lowerEventSuppresionAndTest()) {
             fireIntervalAdded(this, that.getVerseAt(0), that.getVerseAt(that.countVerses() - 1));
@@ -661,10 +656,7 @@
         raiseNormalizeProtection();
 
         Passage temp = (Passage) this.clone();
-        Iterator<Key> it = temp.iterator();
-
-        while (it.hasNext()) {
-            Key verse = it.next();
+        for (Key verse : temp) {
             if (!that.contains(verse)) {
                 remove(verse);
             }
@@ -838,9 +830,7 @@
      */
     public int indexOf(Key that) {
         int index = 0;
-        Iterator<Key> it = iterator();
-        while (it.hasNext()) {
-            Key key = it.next();
+        for (Key key : this) {
             if (key.equals(that)) {
                 return index;
             }
@@ -1276,9 +1266,8 @@
             out.writeInt(BITWISE);
 
             BitSet store = new BitSet(BibleInfo.versesInBible());
-            Iterator<Key> it = iterator();
-            while (it.hasNext()) {
-                Verse verse = (Verse) it.next();
+            for (Key aKey : this) {
+                Verse verse = (Verse) aKey;
                 store.set(verse.getOrdinal() - 1);
             }
 
@@ -1290,9 +1279,8 @@
             out.writeInt(countVerses());
 
             // write the verse ordinals in a loop
-            Iterator<Key> it = iterator();
-            while (it.hasNext()) {
-                Verse verse = (Verse) it.next();
+            for (Key aKey : this) {
+                Verse verse = (Verse) aKey;
                 out.writeInt(verse.getOrdinal());
             }
         } else {

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/BitwisePassage.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/BitwisePassage.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/BitwisePassage.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -135,9 +135,8 @@
      */
     @Override
     public boolean contains(Key obj) {
-        Iterator<Key> iter = obj.iterator();
-        while (iter.hasNext()) {
-            Verse verse = (Verse) iter.next();
+        for (Key aKey : obj) {
+            Verse verse = (Verse) aKey;
             if (!store.get(verse.getOrdinal())) {
                 return false;
             }
@@ -158,9 +157,8 @@
 
         Verse firstVerse = null;
         Verse lastVerse = null;
-        Iterator<Key> iter = obj.iterator();
-        while (iter.hasNext()) {
-            lastVerse = (Verse) iter.next();
+        for (Key aKey : obj) {
+            lastVerse = (Verse) aKey;
             if (firstVerse == null) {
                 firstVerse = lastVerse;
             }
@@ -186,9 +184,8 @@
 
         Verse firstVerse = null;
         Verse lastVerse = null;
-        Iterator<Key> iter = obj.iterator();
-        while (iter.hasNext()) {
-            lastVerse = (Verse) iter.next();
+        for (Key aKey : obj) {
+            lastVerse = (Verse) aKey;
             if (firstVerse == null) {
                 firstVerse = lastVerse;
             }
@@ -276,9 +273,8 @@
         } else {
             thatStore = new BitSet(BibleInfo.versesInBible() + 1);
 
-            Iterator<Key> it = that.iterator();
-            while (it.hasNext()) {
-                int ord = ((Verse) it.next()).getOrdinal();
+            for (Key aKey : that) {
+                int ord = ((Verse) aKey).getOrdinal();
                 if (store.get(ord)) {
                     thatStore.set(ord);
                 }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/DistinctPassage.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/DistinctPassage.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/DistinctPassage.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -137,9 +137,8 @@
      */
     @Override
     public boolean contains(Key obj) {
-        Iterator<Key> iter = obj.iterator();
-        while (iter.hasNext()) {
-            if (!store.contains(iter.next())) {
+        for (Key aKey : obj) {
+            if (!store.contains(aKey)) {
                 return false;
             }
         }
@@ -159,9 +158,8 @@
 
         Verse firstVerse = null;
         Verse lastVerse = null;
-        Iterator<Key> iter = obj.iterator();
-        while (iter.hasNext()) {
-            lastVerse = (Verse) iter.next();
+        for (Key aKey : obj) {
+            lastVerse = (Verse) aKey;
             if (firstVerse == null) {
                 firstVerse = lastVerse;
             }
@@ -187,9 +185,8 @@
 
         Verse firstVerse = null;
         Verse lastVerse = null;
-        Iterator<Key> iter = obj.iterator();
-        while (iter.hasNext()) {
-            lastVerse = (Verse) iter.next();
+        for (Key aKey : obj) {
+            lastVerse = (Verse) aKey;
             if (firstVerse == null) {
                 firstVerse = lastVerse;
             }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/KeyUtil.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/KeyUtil.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/KeyUtil.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -21,8 +21,6 @@
  */
 package org.crosswire.jsword.passage;
 
-import java.util.Iterator;
-
 import org.crosswire.common.util.Logger;
 
 /**
@@ -49,9 +47,7 @@
      *            The visitor to notify whenever a node is found
      */
     public static void visit(Key key, KeyVisitor visitor) {
-        Iterator<Key> it = key.iterator();
-        while (it.hasNext()) {
-            Key subkey = it.next();
+        for (Key subkey : key) {
             if (subkey.canHaveChildren()) {
                 visitor.visitBranch(subkey);
                 visit(subkey, visitor);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageKeyFactory.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageKeyFactory.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageKeyFactory.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -178,9 +178,8 @@
 
             index += toBinary(buffer, index, AbstractPassage.BITWISE, AbstractPassage.METHOD_COUNT);
 
-            Iterator<Key> it = ref.iterator();
-            while (it.hasNext()) {
-                Verse verse = (Verse) it.next();
+            for (Key aKey : ref) {
+                Verse verse = (Verse) aKey;
                 int ord = verse.getOrdinal();
 
                 // Which byte should we be altering
@@ -206,9 +205,8 @@
             index += toBinary(buffer, index, verses, BibleInfo.versesInBible());
 
             // write the verse ordinals in a loop
-            Iterator<Key> it = ref.iterator();
-            while (it.hasNext()) {
-                Verse verse = (Verse) it.next();
+            for (Key aKey : ref) {
+                Verse verse = (Verse) aKey;
                 int ord = verse.getOrdinal();
                 index += toBinary(buffer, index, ord, BibleInfo.versesInBible());
             }

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageTally.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageTally.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/PassageTally.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -346,10 +346,8 @@
      */
     @Override
     public boolean contains(Key that) {
-        Iterator<Key> it = that.iterator();
-
-        while (it.hasNext()) {
-            Verse verse = (Verse) it.next();
+        for (Key aKey : that) {
+            Verse verse = (Verse) aKey;
             if (board[verse.getOrdinal() - 1] == 0) {
                 return false;
             }
@@ -435,10 +433,8 @@
     public void remove(Key that) {
         optimizeWrites();
 
-        Iterator<Key> it = that.iterator();
-
-        while (it.hasNext()) {
-            Verse verse = (Verse) it.next();
+        for (Key aKey : that) {
+            Verse verse = (Verse) aKey;
             kill(verse.getOrdinal());
         }
 
@@ -465,10 +461,8 @@
 
             incrementMax(that_rt.max);
         } else {
-            Iterator<Key> it = that.iterator();
-
-            while (it.hasNext()) {
-                Verse verse = (Verse) it.next();
+            for (Key aKey : that) {
+                Verse verse = (Verse) aKey;
                 increment(verse.getOrdinal(), 1);
             }
 
@@ -495,10 +489,8 @@
                 increment(i, -that_rt.board[i - 1]);
             }
         } else {
-            Iterator<Key> it = that.iterator();
-
-            while (it.hasNext()) {
-                Verse verse = (Verse) it.next();
+            for (Key aKey : that) {
+                Verse verse = (Verse) aKey;
                 increment(verse.getOrdinal(), -1);
             }
         }
@@ -532,10 +524,8 @@
                 }
             }
         } else {
-            Iterator<Key> it = that.iterator();
-
-            while (it.hasNext()) {
-                Verse verse = (Verse) it.next();
+            for (Key aKey : that) {
+                Verse verse = (Verse) aKey;
                 kill(verse.getOrdinal());
             }
         }
@@ -585,10 +575,7 @@
 
         Passage remainder = (Passage) this.clone();
 
-        Iterator<Key> it = iterator();
-        while (it.hasNext()) {
-            Key verse = it.next();
-
+        for (Key verse : this) {
             if (i > count) {
                 remove(verse);
                 overflow = true;
@@ -728,10 +715,8 @@
      *            The amount to increment/decrement by
      */
     private void alterVerseBase(Key that, int tally) {
-        Iterator<Key> it = that.iterator();
-
-        while (it.hasNext()) {
-            Verse verse = (Verse) it.next();
+        for (Key aKey : that) {
+            Verse verse = (Verse) aKey;
             increment(verse.getOrdinal(), tally);
         }
 
@@ -1087,10 +1072,8 @@
 
                 // Calculate the maximum rank for a verse
                 int rank = 0;
-                Iterator<Key> iter = range.iterator();
-
-                while (iter.hasNext()) {
-                    Verse verse = (Verse) iter.next();
+                for (Key aKey : range) {
+                    Verse verse = (Verse) aKey;
                     int temp = board[verse.getOrdinal() - 1];
                     if (temp > rank) {
                         rank = temp;

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/RangedPassage.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/RangedPassage.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/RangedPassage.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -253,10 +253,9 @@
         new_store.addAll(store);
 
         // go through all the VerseRanges
-        Iterator<Key> iter = new_store.iterator();
-        while (iter.hasNext()) {
+        for (Key aKey : new_store) {
             // if this range touches the range to be removed ...
-            VerseRange this_range = (VerseRange) iter.next();
+            VerseRange this_range = (VerseRange) aKey;
             if (this_range.overlaps(that_range)) {
                 // ... remove it and add the remainder
                 store.remove(this_range);

Modified: trunk/jsword/src/main/java/org/crosswire/jsword/passage/TreeKey.java
===================================================================
--- trunk/jsword/src/main/java/org/crosswire/jsword/passage/TreeKey.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/main/java/org/crosswire/jsword/passage/TreeKey.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -76,9 +76,7 @@
      */
     public int getCardinality() {
         int cardinality = 1; // count this node
-        Iterator<Key> iter = children.iterator();
-        while (iter.hasNext()) {
-            Key child = iter.next();
+        for (Key child : children) {
             cardinality += child.getCardinality();
         }
 
@@ -108,9 +106,7 @@
             return true;
         }
 
-        Iterator<Key> iter = children.iterator();
-        while (iter.hasNext()) {
-            Key child = iter.next();
+        for (Key child : children) {
             if (child.contains(key)) {
                 return true;
             }

Modified: trunk/jsword/src/test/java/org/crosswire/common/diff/DiffTest.java
===================================================================
--- trunk/jsword/src/test/java/org/crosswire/common/diff/DiffTest.java	2010-12-10 19:34:53 UTC (rev 2053)
+++ trunk/jsword/src/test/java/org/crosswire/common/diff/DiffTest.java	2010-12-10 22:12:09 UTC (rev 2054)
@@ -9,7 +9,6 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.List;
 
 import junit.framework.TestCase;
@@ -86,9 +85,7 @@
     private static String[] diff_rebuildtexts(List<Difference> diffs) {
         String[] text = {
                 "", ""};
-        Iterator<Difference> iter = diffs.iterator();
-        while (iter.hasNext()) {
-            Difference myDiff = iter.next();
+        for (Difference myDiff : diffs) {
             EditType editType = myDiff.getEditType();
             if (!EditType.INSERT.equals(editType)) {
                 text[0] += myDiff.getText();




More information about the jsword-svn mailing list