More foreach loops

Project: http://git-wip-us.apache.org/repos/asf/ant-ivy/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant-ivy/commit/8f35a1d2
Tree: http://git-wip-us.apache.org/repos/asf/ant-ivy/tree/8f35a1d2
Diff: http://git-wip-us.apache.org/repos/asf/ant-ivy/diff/8f35a1d2

Branch: refs/heads/master
Commit: 8f35a1d28e795833e6a095ff55ecc37f3db882aa
Parents: 8b9f2d5
Author: twogee <g.grigelio...@gmail.com>
Authored: Sun Jun 11 00:26:54 2017 +0200
Committer: twogee <g.grigelio...@gmail.com>
Committed: Sun Jun 11 00:26:54 2017 +0200

----------------------------------------------------------------------
 .../filter-framework/src/filter/hmimpl/HMFilter.java        | 3 +--
 src/example/dual/project/src/example/HelloIvy.java          | 4 ++--
 src/example/hello-ivy/src/example/HelloConsole.java         | 4 ++--
 src/example/multi-project/projects/list/src/list/Main.java  | 9 ++++-----
 4 files changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/8f35a1d2/src/example/configurations/multi-projects/filter-framework/src/filter/hmimpl/HMFilter.java
----------------------------------------------------------------------
diff --git 
a/src/example/configurations/multi-projects/filter-framework/src/filter/hmimpl/HMFilter.java
 
b/src/example/configurations/multi-projects/filter-framework/src/filter/hmimpl/HMFilter.java
index bcb2e1d..6e8b0ad 100644
--- 
a/src/example/configurations/multi-projects/filter-framework/src/filter/hmimpl/HMFilter.java
+++ 
b/src/example/configurations/multi-projects/filter-framework/src/filter/hmimpl/HMFilter.java
@@ -31,8 +31,7 @@ public class HMFilter implements IFilter {
             return values;
         }
         List<String> result = new ArrayList<String>();
-        for (int i = 0; i < values.length; i++) {
-            String string = values[i];
+        for (String string : values) {
             if (string != null && string.startsWith(prefix)) {
                 result.add(string);
             }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/8f35a1d2/src/example/dual/project/src/example/HelloIvy.java
----------------------------------------------------------------------
diff --git a/src/example/dual/project/src/example/HelloIvy.java 
b/src/example/dual/project/src/example/HelloIvy.java
index bc84237..6125ff0 100644
--- a/src/example/dual/project/src/example/HelloIvy.java
+++ b/src/example/dual/project/src/example/HelloIvy.java
@@ -25,7 +25,7 @@ import org.apache.commons.lang.WordUtils;
  * Simple hello world example to show how easy it is to retrieve libs with ivy,
  * including transitive dependencies
  */
-public final class Hello {
+public final class HelloIvy {
     public static void main(String[] args) throws Exception {
         String  message = "hello ivy !";
         System.out.println("standard message : " + message);
@@ -46,6 +46,6 @@ public final class Hello {
         System.out.println("found logging class in classpath: " + clss);
     }
 
-    private Hello() {
+    private HelloIvy() {
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/8f35a1d2/src/example/hello-ivy/src/example/HelloConsole.java
----------------------------------------------------------------------
diff --git a/src/example/hello-ivy/src/example/HelloConsole.java 
b/src/example/hello-ivy/src/example/HelloConsole.java
index f3d0d45..c3e51d1 100644
--- a/src/example/hello-ivy/src/example/HelloConsole.java
+++ b/src/example/hello-ivy/src/example/HelloConsole.java
@@ -28,7 +28,7 @@ import org.apache.commons.lang.WordUtils;
 /**
  * Simple example to show how easy it is to retrieve transitive libs with ivy 
!!!
  */
-public final class Hello {
+public final class HelloConsole {
     public static void main(String[] args) throws Exception {
         Option msg = OptionBuilder.withArgName("msg")
             .hasArg()
@@ -46,6 +46,6 @@ public final class Hello {
             + " : " + WordUtils.capitalizeFully(message));
     }
 
-    private Hello() {
+    private HelloConsole() {
     }
 }

http://git-wip-us.apache.org/repos/asf/ant-ivy/blob/8f35a1d2/src/example/multi-project/projects/list/src/list/Main.java
----------------------------------------------------------------------
diff --git a/src/example/multi-project/projects/list/src/list/Main.java 
b/src/example/multi-project/projects/list/src/list/Main.java
index 5ae5c8d..c9915b6 100644
--- a/src/example/multi-project/projects/list/src/list/Main.java
+++ b/src/example/multi-project/projects/list/src/list/Main.java
@@ -51,11 +51,10 @@ public final class Main {
 
         CommandLine line = parser.parse(options, args);
         File dir = new File(line.getOptionValue("dir", "."));
-        Collection files = ListFile.list(dir);
-        System.out.println("listing files in " + dir);
-        for (Iterator it = files.iterator(); it.hasNext();) {
-          System.out.println("\t" + it.next() + "\n");
-        }
+          System.out.println("listing files in " + dir);
+          for (Object file : ListFile.list(dir)) {
+              System.out.println("\t" + file + "\n");
+          }
       } catch (ParseException exp) {
           // oops, something went wrong
           System.err.println("Parsing failed.  Reason: " + exp.getMessage());

Reply via email to