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

context variable breaks output transformation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.3, 2.2.0-beta-1
    • Component/s: Groovy Console
    • Labels:
      None

      Description

      Executing the script:

      context="test"

      in GroovyConsole breaks various functionality like output transformations and "Inspect Variables".

      The GroovyConsole accesses the binding (context) of the internal shell via shell.context, thus leading to a call to shell.getProperty(). GroovyShell's getProperty() method however first tries to resolve against its variables. So if a variable with the name "context" is set, GroovyConsole uses its value, instead of the binding.

      Replacing each occurence of shell.context with shell.getContext() should resolve the problem.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              mkresse Martin Kresse
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: