ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [2/3] ant git commit: really remove Java7 and Java8 features
Date Sun, 11 Sep 2016 11:06:25 GMT
really remove Java7 and Java8 features


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

Branch: refs/heads/master
Commit: e95fe11095ecd42ef322a0523f6919cec809391b
Parents: 6ec2478
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sun Sep 11 13:03:28 2016 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sun Sep 11 13:03:28 2016 +0200

----------------------------------------------------------------------
 .../apache/tools/ant/taskdefs/optional/junit/JUnitTask.java | 9 +++++++--
 .../tools/ant/taskdefs/optional/junit/JUnitTaskTest.java    | 4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/e95fe110/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
index d844133..5c78115 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
@@ -21,6 +21,7 @@ package org.apache.tools.ant.taskdefs.optional.junit;
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
+import java.io.FilenameFilter;
 import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.FileWriter;
@@ -1755,7 +1756,7 @@ public class JUnitTask extends Task {
                 null,
                 getProject(),
                 path,
-                true)) {
+                true);
             try {
                 loader.loadClass("junit.framework.Test");
                 return true;
@@ -1780,7 +1781,11 @@ public class JUnitTask extends Task {
         for (String path : modulePath.list()) {
             final File modulePathEntry = getProject().resolveFile(path);
             if (modulePathEntry.isDirectory() && !hasModuleInfo(modulePathEntry))
{
-                final File[] modules = modulePathEntry.listFiles((dir,name)->name.toLowerCase(Locale.ENGLISH).endsWith(".jar"));
+                final File[] modules = modulePathEntry.listFiles(new FilenameFilter() {
+                        public boolean accept(File dir, String name) {
+                            return name.toLowerCase(Locale.ENGLISH).endsWith(".jar");
+                        }
+                    });
                 if (modules != null) {
                     for (File module : modules) {
                         expanded.add(new Path(getProject(), String.format(

http://git-wip-us.apache.org/repos/asf/ant/blob/e95fe110/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
index d817cb1..08daa0e 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
@@ -472,7 +472,7 @@ public class JUnitTaskTest {
             assertNotNull(mockProcLauncher.cmd);
             String resCp = null;
             String resMp = null;
-            Set<String> resExports = new TreeSet<>();
+            Set<String> resExports = new TreeSet<String>();
             for (int i = 1; i< mockProcLauncher.cmd.length; i++) {
                 if ("-classpath".equals(mockProcLauncher.cmd[i])) { //NOI18N
                     resCp = mockProcLauncher.cmd[++i];
@@ -526,7 +526,7 @@ public class JUnitTaskTest {
             assertNotNull(mockProcLauncher.cmd);
             String resCp = null;
             String resMp = null;
-            Set<String> resExports = new TreeSet<>();
+            Set<String> resExports = new TreeSet<String>();
             for (int i = 1; i< mockProcLauncher.cmd.length; i++) {
                 if ("-classpath".equals(mockProcLauncher.cmd[i])) { //NOI18N
                     resCp = mockProcLauncher.cmd[++i];


Mime
View raw message