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

Type checker fails with NPE if a write only property is used in a bean-style constructor call

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.3, 2.3.4
    • 2.3.5
    • None
    • None

    Description

      The following code fails with a NullPointerException when the type checker is used:

                class MyBean {
                      private String var
                      void setFoo(String foo) {
                          var = foo
                      }
                      String toString() { var }
                  }
                  def b = new MyBean(foo: 'Test')
                  assert b.toString() == 'Test'
      

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: