[ 
https://issues.apache.org/jira/browse/JCR-680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462186
 ] 

Jukka Zitting commented on JCR-680:
-----------------------------------

> I agreed with stefan that it's a bit hard to understand how it works. 
> especially because the
> inner classes modify the field of the GenericValue.

Another alternative for the internal InitialValue classes would be to add a 
package-protected setValue() state setter in GenericValue and have the 
InitialValues as normal top-level classes. The current approach achieves 
maximum encapsulation at the expense of the extra complexity of having the 
InitialValues as inner classes. I'm not opposed to changing that.

> to only thing i'm not happy with is the 'equals()' and 'hashCode()' 
> implementation. hashcode
> should cache the code, and i suggest that equals delegates to the values. for 
> example it might
> result in very poor performance if 2 date values always need to convert to 
> string for comparison:

I'm not sure how performance-critical the Value equality and hash code 
operations are, thus I'd rather optimize for clarity by default. Also, see 
JCR-598 where the previous date optimization actually caused
incorrect behaviour.


> Improve the Value implementation
> --------------------------------
>
>                 Key: JCR-680
>                 URL: https://issues.apache.org/jira/browse/JCR-680
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jukka Zitting
>         Assigned To: Jukka Zitting
>            Priority: Minor
>         Attachments: class.jpg, GenericValue.patch, GenericValue.tar.gz, 
> JCR-680.patch
>
>
> The current Value implementation found in jackrabbit-jcr-commons has some 
> deficiencies like Value.equals() being incorrect in some cases (see for 
> example JCR-320), and Name and Path values not following namespace remappings.

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

        

Reply via email to