History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GROOVY-1681
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: Antti Karanta
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

null.setProperty yields confusing error message

Created: 29/Jan/07 06:52 AM   Updated: 08/Feb/08 01:26 AM
Component/s: None
Affects Version/s: 1.0
Fix Version/s: 1.5.2

Time Tracking:
Not Specified

Environment: Groovy Version: 1.0 JVM: 1.5.0_10-b03


 Description  « Hide
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



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King - 06/Jan/08 01:58 AM
This was mostly fixed previously but just tweaked a bit more. Now says:
Caught: java.lang.NullPointerException: Cannot set property 'foo' on null object

Paul King - 08/Feb/08 01:26 AM
close off release 1.5.4