diff options
author | Tobias Thierer <tobiast@google.com> | 2016-08-16 14:31:08 +0100 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2016-08-18 11:59:12 +0100 |
commit | 05996f439bd1ef46bdf834875b6b29b02f7bb999 (patch) | |
tree | 0657ebf367efb2cebff7418b13ef96fafc07fba3 /annotations/generate_annotated_java_files.py | |
parent | c8e286ecfdc24e1880820ac14aadcf8234ba7bb9 (diff) |
Update Hashtable to OpenJDK8u60.
This applies upstream changes that were not included in
http://r.android.com/207581
That previous CL had opted to use the default implementations
of Map's default methods (plus wrap them in synchronized)
rather than upstream's implementation of these methods for
Hashtable. This CL keeps does not touch that area of the code.
Added Android-changed comments for remaining local changes to
upstream code:
- The different implementations of the methods that are
default methods in the Map interface, see comment above.
- Naming of Hashtable.HashtableEntry
- Ignore load factor for computing threshold
Added a test to ensure that Hashtable.HashtableEntry does not
accidentally get renamed to Entry, which would hide Map.Entry.
This is based on the existing test for
LinkedHashMap.LinkedHashMapEntry.
Notes:
- Upstream dropped the static helper method "int hash(Object)"
and replaced it with key.hashCode(). That new behavior matches
what Android already did. Note that before this CL,
HastableEntry.hashCode() already used key.hashCode(). This
would not have worked correctly if hash() had done anything
other than key.hashCode().
Other changes included from upstream:
- Pull some initialization out of for loop headers
- Use <?, ?> generics in some places instead of <K, V> or the raw type.
- introduction of @SupressWarnings("unchecked") annotations
and indentation afterwards
- Check for null key/value inside HashtableEntry.equals(); this
appears to have no purpose since Hashtable does not accept
null keys/values. Note that the upstream class Hashtable.Entry
is private so cannot be instantiated elsewhere.
- new helper method addEntry()
Test:
- all libcore tests
- 1359 tests from guava-testlib's MapTestSuiteBuilder
- added support for Hashtable testing to guava-testlib
in a separate CL
- make update-api
Bug: 29935305
Change-Id: Ib3830c0bf4b6d12ed24a0b5a3c76196a3bd0412f
Diffstat (limited to 'annotations/generate_annotated_java_files.py')
0 files changed, 0 insertions, 0 deletions