Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6-beta-2
-
Fix Version/s: 1.6-rc-1, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Two equal instances of an @Immutable class should produce the same value when used as a map key. This is not the case, even though their hash codes are equal.
The last assert below fails, though it should succeed.
@Immutable final class Foo { String bar } foo1 = new Foo('bar') foo2 = new Foo('bar') assert foo1 == foo2 assert foo1.hashCode() == foo2.hashCode() fooMap = [(foo1) : 1] assert fooMap[foo1] == 1 assert fooMap[foo2] == 1 // Fails!!!
Activity
Guillaume Laforge
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Paul King [ paulk ] |
Paul King
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 1.6-rc-1 [ 14009 ] | |
| Fix Version/s | 1.7-beta-1 [ 14014 ] | |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |