groovy

toString() on NullObject does not throw a NPE

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.0
  • Fix Version/s: 1.1-beta-1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

When called on a null object, the toString() methods reports something like org.codehaus.groovy.runtime.NullObject@2f71e2 while a NPE would be more appropriate.

This causes a problem in GRAILS see GRAILS-648

Activity

Hide
Guillaume ALLEON added a comment -

Solve by jochen adding the toString() method to NullObject. I modified the test.

Show
Guillaume ALLEON added a comment - Solve by jochen adding the toString() method to NullObject. I modified the test.

People

Vote (0)
Watch (0)

Dates

  • Due:
    Created:
    Updated:
    Resolved: