Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1929

Resource Leak in the GroovyScriptEngine

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-2
    • groovy-jdk
    • None
    • Linux

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

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            dcosta72 David Costa Faidella
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: