openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: svn commit: r557089 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/ openjpa-lib/src/main/ja
Date Tue, 31 Jul 2007 05:20:53 GMT
Hi Kevin,

On Jul 30, 2007, at 5:45 AM, Kevin Sutter wrote:

> I haven't found all of the details on the problem report that made  
> this
> change, but the abstract indicates "hashmap performance changes".   
> So, our
> findings would be consistent with that.
> I just wanted to see if anybody thought that this behavior of the
> HashMap.put() was inconsistent with the java spec or if there was some
> strong opinion on the use of == for this situation.

The javadoc for the collections framework indicate that it's the  
"value" of the key that is important. And "everyone knows" that the  
value of an Integer is not the instance itself but the int it contains.

So it seems that the javadoc would allow an equivalent ("interned")  
key to be substituted as long as the substitute key had the same  
value as the proposed key.

On the openjpa side, I think we should use equals instead of == for  
testing as well as normal usage of the map graph keys.


Craig Russell
Architect, Sun Java Enterprise System
408 276-5638
P.S. A good JDO? O, Gasp!

View raw message