Bug #291 (closed)
Opened 18 years ago
Closed 18 years ago
Equals and hashCode are missing for Permissions
Reported by: | jamoore | Owned by: | jamoore |
---|---|---|---|
Priority: | major | Cc: | |
Sprint: | n.a. | ||
Total Remaining Time: | n.a. |
Description
equals and hashCode are implementable and in fact quite useful for the Permissions class.
Change History (4)
comment:1 Changed 18 years ago by jmoore
comment:2 Changed 18 years ago by jmoore
r882 adds this functionality with simple test. The code needed for equals/hashCode is present but commented out.
comment:3 Changed 18 years ago by jmoore
r918 adds sameRights(Permissions) as a less strict equality test.
comment:4 Changed 18 years ago by jmoore
- Keywords set to iteration4
- Resolution set to fixed
- Status changed from new to closed
Closing this with the assumption that when someone needs true equals/hashCode functionality it'll be re-opened.
Because Permissions are mutable, this may cause problems (specifically certain instances getting lost in a Set.). Instead we can provide a non-overriding equality comparison ("identical",e.g.). This may should be rethought and rather than having an immutable wrapper around Permissions, we make Permissions immutable and provide a mutable builder (a la String and StringBuilder).