Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D6C4E200CA7 for ; Wed, 14 Jun 2017 11:37:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D59A3160BF5; Wed, 14 Jun 2017 09:37:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3099A160BEF for ; Wed, 14 Jun 2017 11:37:21 +0200 (CEST) Received: (qmail 10850 invoked by uid 500); 14 Jun 2017 09:37:20 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 10717 invoked by uid 99); 14 Jun 2017 09:37:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2017 09:37:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A97EBDFA0A; Wed, 14 Jun 2017 09:37:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jhm@apache.org To: notifications@ant.apache.org Date: Wed, 14 Jun 2017 09:37:20 -0000 Message-Id: In-Reply-To: <1cc3194e5c3c499eb5db244d540608ae@git.apache.org> References: <1cc3194e5c3c499eb5db244d540608ae@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/11] ant-ivy git commit: More foreach loops archived-at: Wed, 14 Jun 2017 09:37:22 -0000 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 Authored: Sun Jun 11 00:26:54 2017 +0200 Committer: twogee 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 result = new ArrayList(); - 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());