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

propertyMissing(String,Object) called for missing getter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.0
    • 2.4.7
    • None
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: