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

Confusing error message when trying to access a property which is actually a method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.8
    • 5.0.0-alpha-3
    • None
    • None

    Description

      groovy:000> new File('/tmp').lastModified
      ERROR groovy.lang.MissingPropertyException:
      No such property: lastModified for class: java.io.File
      Possible solutions: lastModified
      

      lastModified is actually a method, so I should have used new File('/tmp').lastModified()

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              jkemnade Jochen Kemnade
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: