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

commands return value false is ignored

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.4.0-beta-2
    • Fix Version/s: 2.3.11, 2.4.2
    • Component/s: Groovysh
    • Labels:
      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

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              kaserfoo Felix Kaser
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: