Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.0
-
Fix Version/s: 1.1-beta-2
-
Component/s: groovy-jdk
-
Labels:None
-
Environment:Linux
-
Number of attachments :
Description
at groovy.util.GroovyScriptEngine.getResourceConnection(GroovyScriptEngine.java:126) there is a resource leak:
groovyScriptConn.getInputStream();
The inputStream returned is never closed.
Since this code block goal is to check whether the resource exists or not, one possible solution would be:
groovyScriptConn.getInputStream().close();
or, as another alternative, adding a finally {} block, after catching the exceptions, in where that input stream would be closed (and any potential exception would be handled).