[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1969) updatedMessage, deletedMessage and createdMessage in framework.Home cause NPE if getEntityClass is overridden

Dan Allen (JIRA) jira-events at lists.jboss.org
Wed Oct 3 11:33:03 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-1969?page=comments#action_12380205 ] 
            
Dan Allen commented on JBSEAM-1969:
-----------------------------------

Okay, I thought about this one a little bit more. Here is what I am saying:

1. Should we stop using the entityClass private field directly, so as to allow the user to override getEntityClass() without exception OR should we say, "too bad, you have to call setEntityClass() if you want to avoid the NullPointerException because we are going to use the private field"

2. We should make getId() final. The Home class uses this.id all over the place and if the developer were to override getId() it would lead to lots of NullPointerExceptions. Besides, I don't see a reason for overriding getId(). If we don't make it final, then we need to stop using this.id all over Home.

> updatedMessage, deletedMessage and createdMessage in framework.Home cause NPE if getEntityClass is overridden
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-1969
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1969
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Framework
>         Environment: Mac OSX 10.4.8, Jboss 4.2.1, Seam 1.3.0 
>            Reporter: Damian Harvey
>         Assigned To: Dan Allen
>            Priority: Trivial
>             Fix For: 2.0.1.GA
>
>         Attachments: HomeTest.java, JBSEAM-1969-v1.txt, SimpleEntity.java
>
>
> I am extending an existing class (BookingHome) that extends EntityHome. My BookingHome class needs to override getEntityClass. Doing this then results in a NPE as updatedMessage, deletedMessage and createdMessage refer to entityClass rather than getEntityClass.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list