Issue Details (XML | Word | Printable)

Key: GROOVY-849
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: JJ Furman
Votes: 0
Watchers: 0
Operations

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

+ operator on null string concat causes exception

Created: 20/May/05 11:16 AM   Updated: 26/Sep/07 08:32 PM
Component/s: None
Affects Version/s: 1.0-JSR-1
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified

Environment: Windows 2000, groovy 1.0 jsr-1, jdk 1.4


 Description  « Hide
The following program produces an error:

"
class Employee {
String name
int empId

String toString() { return name + ": " + empId }
}

e = new Employee()
println e
"

The error is "Cannot invoke method: plus on null object". What I expect to see is "null: 0". I can see why this is happening but I don't know the best way to fix it.

Another issue is that when anything goes wrong in groovy, I get a big stacktrace, java style. As a user of the system, I'd rather just see a concise one line error.

Thanks, keep up the good work. I'm certainly going to keep my eye on this language.
JJ Furman



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Paul King added a comment - 24/Jun/07 05:06 AM
I don't know when this changed, but in HEAD this now prints:

null: 0


Paul King added a comment - 26/Sep/07 08:32 PM
No further feedback, assuming fixed