Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.6
-
Fix Version/s: 1.0.5
-
Component/s: None
-
Labels:None
Description
When calling toString in log statement on class that inherits from parent class, "SomeClassName : null" is printed instead of "SomeClassName : 1"
grails create-app nullInToString
cd nullInToString
grails create-domain-class Person
grails create-domain-class Customer
abstract class Person {
String name
}
class Customer extends Person {
Date firstContactDate
}
grails generate-all Customer
edit CustomerController:
def show = { def customer = Customer.get( params.id ) log.info("returning customer: $customer") [ customer : customer ] }
Bootstrap:
def init = { servletContext ->
new Customer (name:"mike", firstContactDate:new Date()).save()
}
grails run-app
log output:
2007-09-24 09:17:54.233::INFO: Started SelectChannelConnector@0.0.0.0:8080
Server running. Browse to http://localhost:8080/nullInToString
[9575] controller.CustomerController returning customer: Person : null
Notice the log statement shows Person: null instead of Person: 1
Attachments
Issue Links
| This issue relates to: | ||||
| GRAILS-5099 | CLONE -toString() not inherited properly |
|
|
|
| GRAILS-1165 | toString() not inherited properly |
|
|
|
this could be related to http://jira.codehaus.org/browse/GRAILS-1313