groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [groovy] branch master updated: Improve the robustness of closing resources
Date Sun, 17 Nov 2019 07:25:19 GMT
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 148d14f  Improve the robustness of closing resources
148d14f is described below

commit 148d14fb9c5642fe9a30d16630766470033d702c
Author: Daniel Sun <sunlan@apache.org>
AuthorDate: Sun Nov 17 15:24:03 2019 +0800

    Improve the robustness of closing resources
---
 src/main/java/groovy/lang/GroovyClassLoader.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main/java/groovy/lang/GroovyClassLoader.java b/src/main/java/groovy/lang/GroovyClassLoader.java
index afc52ff..cd44d74 100644
--- a/src/main/java/groovy/lang/GroovyClassLoader.java
+++ b/src/main/java/groovy/lang/GroovyClassLoader.java
@@ -630,8 +630,11 @@ public class GroovyClassLoader extends URLClassLoader {
 
         @Override
         public void close() throws IOException {
-            super.close();
-            delegate.close();
+            try {
+                super.close();
+            } finally {
+                delegate.close();
+            }
         }
 
         public long getTimeStamp() {


Mime
View raw message