Hi Rong and all,
I am in the process of migrating from the older Java RM implementation and ran into a few (surprisingly minor) problems:
- ArchetypeSlots / CString
When I compare two identical ArchetypeSlots for equality, this returns false.
It took me a while to track this down, but it seems that the origin of this error is that CString implements the hashCode() method wrongly.
CString - in contrast to other CPrimitives and in contrast to its equals method appends the hashCode of super: .appendSuper(super.hashCode())
This is the reason why comparing two ArchetypeSlots with set includes or excludes returns false even though they are identical.
This bug? was introduced in Revision 520 (log message: removed immutable object pattern to facilitate template flattening) - not sure why?
In any case, I would like to remove this again, so that this works again. (Alternatively, we could add it to all the CPrimitives and implement the hashCode + equals methods for CPrimitive)
- PARTY_PROXY
I would like to make the constructor of this class public instead of protected.
For the Archetype Validator, we need this to be public for it to be picked up properly and recognised as a RM class that we can constrain.
Is there a problem with making this public?
- ArchetypeConstraint
One minor thing, this hasn’t caused me any problems so far, but there is a discrepancy between the equals and hashCode method in ArchetypeConstraint.
The hashCode is considering hiddenOnForm while the equals methods is not. This seems to violate the contract between hashCode and hiddenOnForm
What do you think? I have made the necessary changes and can commit this if you agree
Cheers
Sebastian