-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b22
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8290112 | 11.0.17 | Dukebot | P4 | Resolved | Fixed | b01 |
Currently, the class `com.sun.tools.javac.util.IntHashTable` exposes the methods `hash(Object key)` and `lookup(Object key)`. It is not good because they are internal methods to achieve the features.
On the other hand, the index of the mapping (key or value) is the internal data struct. The javac developers who use this class should not know or use the index outside `IntHashTable`. So the parameters of the following methods could be revised.
1. lookup(Object key, int hash) -> lookup(Object key)
2. getFromIndex(int index) -> get(Object key)
3. putAtIndex(Object key, int value, int index) -> put(Object key, int value)
And the corresponding places where they are used need to be adjusted too.
On the other hand, the index of the mapping (key or value) is the internal data struct. The javac developers who use this class should not know or use the index outside `IntHashTable`. So the parameters of the following methods could be revised.
1. lookup(Object key, int hash) -> lookup(Object key)
2. getFromIndex(int index) -> get(Object key)
3. putAtIndex(Object key, int value, int index) -> put(Object key, int value)
And the corresponding places where they are used need to be adjusted too.
- backported by
-
JDK-8290112 Optimize IntHashTable for encapsulation and ease of use
-
- Resolved
-