groovy

null.setProperty yields confusing error message

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.5.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Groovy Version: 1.0 JVM: 1.5.0_10-b03
  • Number of attachments :
    0

Description

C:\>groovy -e "null.setProperty('foo','bar')"
Caught: groovy.lang.MissingPropertyException: No such property: foo for class: org.codehaus.groovy.runtime.NullObject
at script_from_command_line.run(script_from_command_line:1)
at script_from_command_line.main(script_from_command_line)

At least I would expect a nice and familiar NPE

Activity

Hide
Paul King added a comment -

This was mostly fixed previously but just tweaked a bit more. Now says:

Caught: java.lang.NullPointerException: Cannot set property 'foo' on null object
Show
Paul King added a comment - This was mostly fixed previously but just tweaked a bit more. Now says:
Caught: java.lang.NullPointerException: Cannot set property 'foo' on null object
Hide
Paul King added a comment -

close off release 1.5.4

Show
Paul King added a comment - close off release 1.5.4

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: