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

groovy.sql.Sql.newInstance(Map<String, Object>) remove params

    XMLWordPrintableJSON

Details

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

      Attachments

        Activity

          People

            paulk Paul King
            aaaia aaaia
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: