Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.7.0
-
None
-
any
Description
GroovyClassLoader leaves file handles open.
We use Groovy scripts within an application server. On systems that protect open files with locks (e.g. Windows) this bug prevents Groovy scripts from being redeployed.
The following code shows the problem:
public void test() throws Exception { final File l_fileScript; final GroovyClassLoader l_ldr; final GroovyCodeSource l_cs; final Class<?> l_classScript; l_fileScript = new File("path/to/script1944A6CADCE5EBA2BE66D50EA1D8AE36562C645E.groovy"); l_ldr = new GroovyClassLoader(); l_cs = new GroovyCodeSource(l_fileScript); l_cs.setCachable(false); l_classScript = l_ldr.parseClass(l_cs); return; // set breakpoint here }
At the breakpoint the handle of the script file is still open.