ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject [1/3] ant git commit: remove try-with-resources
Date Sun, 11 Sep 2016 11:06:24 GMT
Repository: ant
Updated Branches:
  refs/heads/master 9bb1b77cd -> 3f552b1e5


remove try-with-resources


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

Branch: refs/heads/master
Commit: 6ec24785039de8c3a159789a44ef80de507bfbc2
Parents: bda488e
Author: Stefan Bodewig <bodewig@apache.org>
Authored: Sun Sep 11 12:58:18 2016 +0200
Committer: Stefan Bodewig <bodewig@apache.org>
Committed: Sun Sep 11 12:58:18 2016 +0200

----------------------------------------------------------------------
 .../apache/tools/ant/taskdefs/optional/junit/JUnitTask.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/6ec24785/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 14f9aa4..d844133 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
@@ -1749,7 +1749,9 @@ public class JUnitTask extends Task {
      * @since 1.9.8
      */
     private boolean hasJunit(final Path path) {
-        try (AntClassLoader loader = AntClassLoader.newAntClassLoader(
+        AntClassLoader loader = null;
+        try {
+            loader = AntClassLoader.newAntClassLoader(
                 null,
                 getProject(),
                 path,
@@ -1760,6 +1762,10 @@ public class JUnitTask extends Task {
             } catch (final Exception ex) {
                 return false;
             }
+        } finally {
+            if (loader != null) {
+                loader.close();
+            }
         }
     }
 


Mime
View raw message