persistence@glassfish.java.net

Re: Fixing issue #383

From: Guy Pelletier <guy.pelletier_at_oracle.com>
Date: Wed, 15 Mar 2006 09:16:43 -0500

Actually I was already looking at this. Go ahead and use option A for now.
We will plan to take a look at this again after 100% CTS compliance.

Cheers,
Guy

----- Original Message -----
From: "Tom Ware" <tom.ware_at_oracle.com>
To: <persistence_at_glassfish.dev.java.net>
Sent: Wednesday, March 15, 2006 8:43 AM
Subject: Re: Fixing issue #383


> That sounds fine to me.
>
> -Tom
>
> Craig L Russell wrote:
>
>>Hi Marina,
>>
>>FWIW, I like to use pattern b if it's a one-shot issue (which this sounds
>>like). There's no downside to creating a hashtable once. If you are
>>constantly creating it and testing for an empty hashset, it's easier to
>>have the hashset defined as null and avoid the construction.
>>
>>Craig
>>
>>On Mar 14, 2006, at 6:53 PM, Marina Vatkina wrote:
>>
>>
>>>Tom,
>>>
>>>The NPE is caused by the following code m_session.getProject
>>>().getAliasDescriptors().remove("");
>>>
>>>When there are no entities in the PU, the alias descriptors
>>>hashtable is null because it's never created.
>>>
>>>There are 2 options to fix it:
>>>a) change the line above to
>>>Hashtable d = m_session.getProject().getAliasDescriptors();
>>>if (d != null)
>>> d.remove("");
>>>
>>>b) Change the Project class to create aliasDescriptors in the
>>>constructor.
>>>
>>>If you don't see a problem with ether fix, I can make the change.
>>>
>>>regards,
>>>-marina
>>>
>>
>>Craig Russell
>>Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
>>408 276-5638 mailto:Craig.Russell_at_sun.com
>>P.S. A good JDO? O, Gasp!
>>
>>
>
> --
> Tom Ware
> Principal Software Engineer
> Oracle Canada Inc.
>
> Direct: (613) 783-4598
> Email: tom.ware_at_oracle.com
>