Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
1.7.10
-
Windows XP SP2, JDK 1.6.0_27
Description
method groovy.sql.Sql.newInstance(Map<String, Object>) can be nicely used with ConfigSlurper, the problem is that it removes parameters from method call argument, so source code:
def res = new ConfigSlurper().parse(new File('resource/Resources.groovy').toURI().toURL()) files.each { def sql = Sql.newInstance(res.db) //do something sql.close() }
fails on second iteration due to parameters had been removed from res.db map and param "url" can not be found
the solution may be changing args.remove to args.get in procedure groovy.sql.Sql.newInstance(Map<String, Object>)