groovy

Resource Leak in the GroovyScriptEngine

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical 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 :
    0

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).

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: