openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2197) MethodComparator in AnnotationPersistenceMetaDataParser should also compare parameters
Date Thu, 17 May 2012 06:49:02 GMT


Mark Struberg commented on OPENJPA-2197:

We currently use the Method#hashCode in the MethodComparator. But this is really ugly, as
it's defined as :
     * Returns a hashcode for this <code>Method</code>.  The hashcode is computed
     * as the exclusive-or of the hashcodes for the underlying
     * method's declaring class name and the method's name.
Please note that Method#hashCode does *NOT* cover any method parameters!

As we do already equals on class and the method name, this doesn't bring any benefit. 
> MethodComparator in AnnotationPersistenceMetaDataParser should also compare parameters
> --------------------------------------------------------------------------------------
>                 Key: OPENJPA-2197
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 2.2.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 2.3.0
>         Attachments: OPENJPA-2197_test.patch
> AnnotationPersistenceMetaDataParser contains a MethodComparator which only compares the
class + the method name. Too bad I have (had...) 2 methods with the same name in my EntityListener:
>     @PreUpdate
>     public void updateChangeLog(Object entity) { ..
> and also
>     private void updateChangeLog(BaseEntity he, ChangeLogEntry cle)
> which is a private helper method.
> Due to the bug in MethodComparator, my @PreUpdate sometimes didn't get detected.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message