openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1755) MultiClassLoader relies on its underlying ClassLoaders for hashCode
Date Sun, 01 Aug 2010 21:53:15 GMT
MultiClassLoader relies on its underlying ClassLoaders for hashCode
-------------------------------------------------------------------

                 Key: OPENJPA-1755
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1755
             Project: OpenJPA
          Issue Type: Bug
            Reporter: Patrick Linskey


The MultiClassLoader relies on its underlying ClassLoaders in its hashing algorithm. This
is problematic if the underlying classloaders refuse to return a hash or if the classloader
list changes over time.

I ran into a problem that demanded a resolution to this issue when doing some work with OpenJPA
in a Google AppEngine context. I don't have a stack trace handy.

An effective-yet-ugly fix was to simply change the hashCode() implementation to return a constant
value (I chose '1'). This clearly is a crappy hashing algorithm, but will always respect the
hashing contract. And I don't think that we really put MultiClassLoaders into big maps or
anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message