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

commands return value false is ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.2, 2.4.0-beta-2
    • 2.3.11, 2.4.2
    • Groovysh
    • None

    Description

      Since the last result is not set for results that are either null or false, the result is also not printed to the console.

      This is highly confusing if you have a command that returns a boolean value. if the return value is true, it will be shown at set as last result, if it is false it looks like it gets ignored.

      This can be traced back to https://github.com/groovy/groovy-core/blob/master/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Groovysh.groovy#L134

      I don't think this is the correct behavior. I understand the null case, but false should clearly be a valid return value for a command.

      Attachments

        Activity

          People

            melix Cédric Champeau
            kaserfoo Felix Kaser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: