-
Enhancement
-
Resolution: Fixed
-
P4
-
8, 11, 13
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8224959 | 11.0.5-oracle | Sean Coffey | P4 | Resolved | Fixed | b01 |
JDK-8228886 | 11.0.5 | Tagir Valeev | P4 | Resolved | Fixed | b02 |
JDK-8230063 | openjdk8u232 | Tagir Valeev | P4 | Resolved | Fixed | b05 |
JDK-8224960 | 8u231 | Sean Coffey | P4 | Resolved | Fixed | b01 |
JDK-8229646 | emb-8u231 | Sean Coffey | P4 | Resolved | Fixed | b01 |
JDK-8226237 | 7u241 | Sean Coffey | P4 | Resolved | Fixed | b01 |
Currently Collections.nCopies().hashCode() delegates to AbstractList.hashCode() which creates an iterator and caculates the hashCode of the same element n times. An optimized implementation is possible which:
- Doesn't create an iterator
- Calls element.hashCode() at most once
- Has O(log(n)) complexity
Also specialized implementation of CopiesList.equals() is possible which at least can check whether another object is also a CopiesList (in this case, no iteration is necessary, just compare single element and size).
- Doesn't create an iterator
- Calls element.hashCode() at most once
- Has O(log(n)) complexity
Also specialized implementation of CopiesList.equals() is possible which at least can check whether another object is also a CopiesList (in this case, no iteration is necessary, just compare single element and size).
- backported by
-
JDK-8224959 Optimize Collections.nCopies().hashCode() and equals()
- Resolved
-
JDK-8224960 Optimize Collections.nCopies().hashCode() and equals()
- Resolved
-
JDK-8226237 Optimize Collections.nCopies().hashCode() and equals()
- Resolved
-
JDK-8228886 Optimize Collections.nCopies().hashCode() and equals()
- Resolved
-
JDK-8229646 Optimize Collections.nCopies().hashCode() and equals()
- Resolved
-
JDK-8230063 Optimize Collections.nCopies().hashCode() and equals()
- Resolved
(1 backported by)