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

Add @ClosureParams to closure input parameter of Sql.withInstance(...)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5.8
    • 2.5.9, 3.0.0-rc-1
    • SQL processing
    • None

    Description

      The various overloadings of Sql.withInstance do not specify the input parameter type of the closure, which is groovy.sql.Sql. Hence, if you want even minimal help from the IDE you won't get anything, unless you declare the input type in your closure declaration:

      Example:

      Sql.withInstance(url, user, pass) { sql ->
        sql.connec| <= invoke code assist here
      }
      

      The IDE does not give any help and, if the surrounding code is type checked, you'll even get a compilation error.

      Required workaround:

      Sql.withInstance(url, user, pass) { Sql sql ->
        sql.connec| <= invoke code assist here
      }
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              mauromol Mauro Molinari
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h