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

"Possible solutions" message is confusing because it doesn't reflect whether a property is read-only or write-only

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.6
    • 5.0.0-alpha-3
    • groovy-runtime
    • None

    Description

      Consider this:

      class Foo {
        void setBar(String bar) {}
      }
      
      foo = new Foo()
      
      println foo.bar
      

      The message is

      groovy.lang.MissingPropertyException: No such property: bar for class: Foo
      Possible solutions: bar
      

      This is extremely confusing to users and I suggest that the message be changed to reflect that the property is write-only to avoid confusion

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              graemerocher Graeme Rocher
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: