Issue Details (XML | Word | Printable)

Key: GROOVY-1929
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Guillaume Laforge
Reporter: David Costa Faidella
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Resource Leak in the GroovyScriptEngine

Created: 01/Jun/07 10:03 AM   Updated: 01/Jul/07 01:08 PM
Component/s: groovy-jdk
Affects Version/s: 1.0
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified

Environment: Linux


 Description  « Hide
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).



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.