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

Groovy could provide some minimal methods to assist with migrating between Groovy versions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.5.10, 4.0.0-alpha-1, 3.0.1
    • None
    • None

    Description

      The goal would be to allow code like:

      def slurper = GroovySystem.shortVersion.isAtLeast('3.0') ? new groovy.xml.Slurper() : new groovy.util.XmlSlurper()
      

      Out of scope:

      • this is not a full blown version api/utility
      • this isn't catering to allow migration scenarios, e.g. the above example is over-simplified for illustrative purposes; it is only useful as is in dynamic contexts and really needs to use reflection even for that case
      • these methods aren't available in all Groovy versions, so while not fully solving the problem, act as reference implementations in the meantime (we may backport these to some earlier branches but that still doesn't solve the problem for existing releases)

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 1h
                  1h