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

propertyMissing(String,Object) called for missing getter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Tested with Groovy 1.8.0, 2.1.0, 2.2.2, and 2.4.0.

      Description

      GROOVY-2098 says that propertyMissing(String) is for getters, while propertyMissing(String,Object) is for setters.

      But as the code snippet below shows, when propertyMissing(String) is missing, missing getters are handled by propertyMissing(String,Object):

      class Sample {
      
          /**
          def propertyMissing(String name) {
              return "propertyMissing(String)"
          }
          **/
      
          def propertyMissing(String name, value) {
              return "propertyMissing(String,Object)"
          }
      }
      
      println new Sample().missing // Prints `propertyMissing(String,Object)`
      

      Is this a bug?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jwagenleitner John Wagenleitner
                Reporter:
                yihtserns Yih Tsern
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: