Commits

Matt Hurne  committed 9d2a8ae

Minor cleanup

  • Participants
  • Parent commits de2e186

Comments (0)

Files changed (3)

File engine/src/main/java/deepdiff/core/DiffUnitProcessor.java

     /**
      * <p>
      * Processes a single DiffUnit. Usually, this processing involves locating {@link DiffPoint}s in
-     * the unit, and passing them to the specified {@link DiffUnitProcessor}.
+     * the unit, and passing them to the specified {@link DiffPointProcessor}.
      * </p>
      * 
      * <p>

File engine/src/main/java/deepdiff/scope/FileDiffScope.java

 
 import java.io.File;
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
      * @param f1 the File on the left to scan
      * @param f2 the File on the right to scan
      * @param unitProcessor the unit processor to pass {@link DiffUnit}s to
-     * @param pointProcessor the point process to pass to the unit processor
+     * @param pointProcessor the point processor to pass to the unit processor
      */
     private void scan(File f1, File f2, DiffUnitProcessor unitProcessor,
             DiffPointProcessor pointProcessor) {
             SortedSet<String> names = new TreeSet<String>();
             names.addAll(Arrays.asList(f1.list()));
             names.addAll(Arrays.asList(f2.list()));
-            for (Iterator<String> it = names.iterator(); it.hasNext();) {
-                String name = (String) it.next();
+            for (String name : names) {
                 File c1 = new File(f1, name);
                 File c2 = new File(f2, name);
                 scan(c1, c2, unitProcessor, pointProcessor);
      * 
      * @return the root directory on the right
      */
+    @SuppressWarnings("unused")
     File getRightRoot() {
         return root2;
     }

File engine/src/main/java/deepdiff/unitprocessor/DelegatingDiffUnitProcessor.java

 import java.io.InputStream;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.Map;
      */
     public DiffScope processDiffUnit(DiffUnit diffUnit, DiffPointProcessor processor) {
         String scopedPath = diffUnit.getScopedPath();
-        for (Iterator<Pattern> it = excludes.iterator(); it.hasNext();) {
-            Pattern pattern = it.next();
+        for (Pattern pattern : excludes) {
             if (pattern.matcher(scopedPath).matches()) {
                 log.debug("Skipping unit due to exclude: " + scopedPath);
                 return null;
             processor.processDiffPoint(diffPoint);
         } else if (!leftIsDir && !rightIsDir) {
             boolean foundHandler = false;
-            for (Iterator<Map.Entry<String, DiffUnitProcessor>> it = handlers.entrySet().iterator(); it
-                    .hasNext();) {
-                Map.Entry<String, DiffUnitProcessor> entry = it.next();
+            for (Map.Entry<String, DiffUnitProcessor> entry : handlers.entrySet()) {
                 String regex = entry.getKey();
                 if (scopedPath.matches(regex)) {
                     DiffUnitProcessor fileHandler = entry.getValue();