Hashtable: Use upstream OpenJDK8u121-b13 versions of Map default methods
In Android N, the implementation of these methods was built on the Map default implementation which in turn was built on top of get(), put(), containKey() etc. This can lead to behavior differences in subclasses of Hashtable that have overridden only those methods and rely on the details of how these methods were implemented on top of those in Android. Such reliance on implementation details would be inappropriate / not reasonable for an app to do and is therefore not supported. The new implementation (identical (*) to upstream) should generally be faster, since it can make use of e.g. the fact that Hashtable can not contain null keys or values. However, Hashtable performance is not currently covered by tests so this has not been empirically measured. (*) Note that the upstream name for Hashtable.HashtableEntry is Hashtable.Entry, so the added code that referred to that class has been adjusted accordingly. Test: CtsLibcoreTestCases -t org.apache.harmony.tests.java.util.HashtableTest Test: CtsLibcoreTestCases -t libcore.java.util.HashtableTest Test: CtsLibcoreTestCases Bug: 35916491 Change-Id: Icddcfa442de6f2ca9f186fa7f489f9b9c0638d9a
Loading
Please sign in to comment