• Home
  • History
  • Annotate
  • only in /libcore/ojluni/src/main/java/java/util/
History log of /libcore/ojluni/src/main/java/java/util/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a9d6051d032667ff6dff4353334166dd7250c007 12-Apr-2018 Victor Chang <vichang@google.com> Add min API level of 26 for the named capaturing in javadoc

- Named capaturing is only supported since API level 26 (Oreo)
- Although the constructs are available since ICU 55 (Marshmallow),
the API in Matcher wasn't added until API level 26, and there was
no CTS before Oreo. Thus, Android only officially supports it since O.

Bug: 71727710
Test: m docs
Merged-In: Ib04f3fcfb831be50f4e77b4ca8c2952349e1db77
Change-Id: Ib04f3fcfb831be50f4e77b4ca8c2952349e1db77
(cherry picked from commit d88def68d81a371284ed1c25a7b038cfefe0ccf3)
egex/Pattern.java
00596ea5e155798247217a6f2af28b2e95cf556e 09-Apr-2018 Victor Chang <vichang@google.com> Merge "Update java.util.Locale ICU data information" into pi-dev
6e998a85a776620b566f8800df0c0d9fe3829ed9 12-Feb-2018 Przemyslaw Szczepaniak <pszczepaniak@google.com> Update java.util.Locale ICU data information

Test: make docs
Bug: 69787930

Merged-In: I3e04764ab63db4ca8593af237d21967d336d96ad
Change-Id: I3e04764ab63db4ca8593af237d21967d336d96ad
(cherry picked from commit 50029b3c387d58c554f5b40cb25e018c8db52579)
ocale.java
28bef292b8b6d2c2841d33cc8aec7dde6a9e84a0 06-Apr-2018 Tobias Thierer <tobiast@google.com> Fix up additional broken documentation links.

Because these links were missing the openjdk-redirect.html part, they
were going to broken http:/../ style URLs in generated documentation
that is currently live at eg.:

https://developer.android.com/reference/java/util/LinkedHashMap.html
(This class is a member of the Java Collections Framework.)

Bug: 77688043
Test: "make docs" and checked that the link in LinkedHashMap.html
now goes to:
../../..//openjdk-redirect.html?v=8&path=/technotes/guides/collections/index.html
and that that link works when manually applied relative to the
location where LinkedHashMap.html is currently published.

(cherry picked from commit 485a043306d328035182e2ca925a7401bd7eb56b)

Change-Id: If67ea16271c0a9f1336f15cbf8f7abdb968dd3b5
Merged-In: If67ea16271c0a9f1336f15cbf8f7abdb968dd3b5
inkedHashMap.java
004a6a70e1dd5bd5817a7065092cbb1e6fa43115 14-Feb-2018 Andreas Gampe <agampe@google.com> Libcore: Disable IsInstanceOfClass warning.

For now, disable the warning until the issue is fixed upstream.

Bug: 73288967
Bug: 73344263
Test: m javac-check RUN_ERROR_PRONE=true
Change-Id: Ic568d2adafd63b107e526e4115c31bd8ac2e2105
ollections.java
e31b37859051d3902e06e4ba384995df7188917f 02-Dec-2017 Hans Boehm <hboehm@google.com> Add reachabilityFence, ReachabilitySensitive

Add the @ReachabilitySensitive annotation itself, and use it
in libcore itself, where needed.

Import OpenJDK9+181's reachabilityFence, so that it can be used in
preference to the annotation where it makes sense. Java 9's
stopgap reachabilityFence implementation doesn't work for us,
so replace it with a different stopgap.

The libcore changes correct many situations in which finalizers
could previously run prematurely according to the JLS. Or they
would correct them if we had a real implementation for
@ReachabilitySensitive.

The ZipFile constructor could close the file before notifying the
CloseGuard that it was open.

Aside from the ZipFile change, there should be no functional
change, yet.

Note that the ExemptionMechanism.java fix is the same as upstream.

Conspicuously missing:

- Any code, e.g. in ART or D8, that actually looks for the annotation.
- Uses in frameworks code, where it's probably most critical.

Bug: 63934467
Bug: 70906684
Bug: 28342794
Test: Build & boot AOSP
Change-Id: I652f0625b39b2ba9ac901d4f63e6aa6cf3b74af5
imer.java
oncurrent/Executors.java
oncurrent/ThreadPoolExecutor.java
egex/Matcher.java
egex/Pattern.java
ip/Deflater.java
ip/Inflater.java
ip/ZipFile.java
52c8fbf265cfac2022cee75068509ac2538eda71 17-Aug-2016 Tobias Thierer <tobiast@google.com> Revert "Workaround bogus TreeMap Comparators."

This was a temporary workaround for app compatibility in Android N and O.

Bug: 27913360
Test: CtsLibcoreTestCases

This reverts commit 78562a12977fc4d81cd31e7c5af05d66bb701ccd.

Change-Id: I3a2377ed4dc4da846828ee4b08b3037fc3045fe5
reeMap.java
8139b364d65ae1e7eed06ae3d24ae77f8a3b14c2 22-Dec-2017 Tobias Thierer <tobiast@google.com> Improve change markers for TimeUnit, VerifyAccess.

- Like the other classes in java.util.concurrent,
TimeUnit is based on a revision of OpenJDK 9
between 9b113 and 9b114.
- VerifyAccess is based on OpenJDK 8u60 and should
be updated to OpenJDK 8u121-b13 in a future CL.

Bug: 35910877
Bug: 62527337
Test: ${ANDROID_BUILD_TOP}/libcore/tools/upstream/upstream-diff \
-r ojluni,8u60 sun.invoke.util.VerifyAccess
Test: ${ANDROID_BUILD_TOP}/libcore/tools/upstream/upstream-diff \
-r ojluni,9b113+ java.util.concurrent.TimeUnit

Change-Id: Ic507161b36bdaa288f25978c5dca65506746b907
oncurrent/TimeUnit.java
246f0cdc37b690903c1687745050e0d9c23e917e 19-Dec-2017 Neil Fuller <nfuller@google.com> Improve change marker for API difference

Improve change marker for API difference we have for
backwards compatibility.

Bug: 28099367
Test: build
Change-Id: Ibffd10f0a1079ac7ff1ad0863cc43df5f646c8e1
oncurrent/ConcurrentHashMap.java
fd6b870e45945adb8c91cf1b53442455ca0cd8b6 05-Oct-2017 Victor Chang <vichang@google.com> Replace clearCachedDefault with setICUDefault

- New method setICUDefault from upstream ICU starting from 60
can clear the default timezone. It has the same effect as method
clearCachedDefault in Android.
- In favour of the new method from upstream,
the local patch http://r.android.com/233357
has been removed in Android.

Bug: 30938145
Test: cts-tradefed run cts -m CtsLibcoreTestCases --test
libcore.java.util.TimeZoneTest
Change-Id: I288ce425de626a6bc96a8b4a88adec1b5ffb6d05
imeZone.java
e1754ddc8656fa8b2c1a0ec828125820a190fd13 12-Sep-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Increase ZipFile read buffers size to 64k

Fixes performance regression introduced in Android N.
Increased size of buffer for Inflater in ZipFile.getInputStream from 8k to 64k.
Replaced temp stack in bufferZipFile_read with GetByteArrayElements.

ZipFileReadBenchmark results on pixel device:

Without the change:
Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=1024}}
runtime(ns): min=11591794.71, 1st qu.=11591794.71, median=11591794.71, mean=11591794.71, 3rd qu.=11591794.71, max=11591794.71
Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=16384}}
runtime(ns): min=4913842.09, 1st qu.=4913842.09, median=4913842.09, mean=4913842.09, 3rd qu.=4913842.09, max=4913842.09
Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=65536}}
runtime(ns): min=4888673.69, 1st qu.=4888673.69, median=4888673.69, mean=4888673.69, 3rd qu.=4888673.69, max=4888673.69

With the change:
Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=1024}}
runtime(ns): min=11415217.04, 1st qu.=11415217.04, median=11415217.04, mean=11415217.04, 3rd qu.=11415217.04, max=11415217.04
Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=16384}}
runtime(ns): min=2690763.53, 1st qu.=2690763.53, median=2690763.53, mean=2690763.53, 3rd qu.=2690763.53, max=2690763.53
Experiment {instrument=runtime, benchmarkMethod=timeZipFileRead, vm=default, parameters={readBufferSize=65536}}
runtime(ns): min=2202639.03, 1st qu.=2202639.03, median=2202639.03, mean=2202639.03, 3rd qu.=2202639.03, max=2202639.03

Test: vogar run of test in *.java.util.zip packages
Bug: 65491407
Change-Id: I7734dde9e6e02b1fbff7209c1256a16ded1654e6
ip/ZipFile.java
36b1ba26083aa249ffc541c6d9d362d01ac3c9d1 08-Sep-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Update java.util.Locale with Oreo release name

Test: make docs
Bug: 35863584
Change-Id: Ie2350b2b4f504d0372ccb4b93bb9bf2d0db2f247
ocale.java
acfd9cbe0363ab56a89ef5da892e08bcb2f9e4a2 20-Jul-2017 vichang <vichang@google.com> Merge "Fix comments in Matcher.java and MatcherTest.java"
am: e92ad39933

Change-Id: I84709a1c0fa8eae09718b110cda4fb0deb7ceceb
4f5f16ccda77bc0448b42e4dc36da50e0c100591 19-Jul-2017 Victor Chang <vichang@google.com> Fix comments in Matcher.java and MatcherTest.java

Bug: 33737213
Test: cts-tradefed run cts -m CtsLibcoreTestCases --primary-abi-only
Change-Id: Id4147185591e1237fb99a231a8a39d831b9d3f48
egex/Matcher.java
60541681530b834ee3da9cc9e20c22699d7a25e7 19-Jul-2017 Victor Chang <vichang@google.com> Merge "Fix Matcher.find and reset"
am: 6cdf9d3b7b

Change-Id: I4890aa9f34441b7e68e62900ef8ed725dca25737
faa2342e585ce148d6de982106ec7b5735f07f1f 13-Jul-2017 Victor Chang <vichang@google.com> Fix Matcher.find and reset

- Matcher.find didn't call reset(), but according to the javadoc, it
should.
- reset() didn't obtain a fresh value from mutable CharSequence.
Given that the constructor uses CharSequence, it should obtain a new value
from the CharSequence and match it again

Added 2 tests to verify such behaviors accordingly

Bug: 33737213
Test: cts-tradefed run cts -m CtsLibcoreTestCases --primary-abi-only
Change-Id: I16ce01944b8c1baac9b7947d5551fb030eb95fc8
egex/Matcher.java
adcd2bb5405d6e67b3d87a8aa723f55e8d0c7091 02-Jun-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Remove java.lang.JavaLangAccess" am: 1d1d01d1c6 am: d6c76e1553
am: c820e7124c

Change-Id: I008584ef0dc747334191ad9efb95d10d58a46ec7
20fd9c0841981c93afbce4b9888d5d2589ae9cc1 31-May-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove java.lang.JavaLangAccess

First port of openJdk to libcore took sun.misc.JavaLangAccess
and put it into java.lang to help with Class.getEnumConstantsShared
visibility. This change removes java.lang.JavaLangAccess,
makes Class.getEnumConstantsShared public&hidden and
changes java.util to call getEnumConstantsShared
directly.

Test: make
Bug: 36429512
Change-Id: I547fcebee3a5839d5af05753c9d18e08f54bd335
numMap.java
numSet.java
e6fb85d712c8c0bae0c4edec82677b558d322084 15-May-2017 Adam Vartanian <flooey@google.com> Merge "Make Android-changed markers for SecurityManager-related classes consistent." am: b995e3ddb6 am: d09c9c82f2
am: 6ff0d35b6f

Change-Id: I9bf1f8618df85b2db1bba44ff774b13fd47a6b53
82fdb5400730b9e32b912297d39385a0ef5193b7 12-May-2017 Adam Vartanian <flooey@google.com> Make Android-changed markers for SecurityManager-related classes consistent.

Bug: 38256375
Test: make
Change-Id: Ibdd8a56d324edcc0b6646eaffc825c68c27b17f9
ropertyPermission.java
ogging/LoggingPermission.java
1da0d7be9c3516c02aea5008b53db050d8bf01d9 05-May-2017 Tobias Thierer <tobiast@google.com> Merge "Improve Android-changed documentation for removal of ZoneInfo" am: 571156c7cb am: 103a90b84b
am: d782f0b973

Change-Id: I1eca1e8d8e1c37b8ce391f36d3cc1a76985a2d0e
5f90065cde808c9ac3c5c08bd3835b3d8cfe3300 04-May-2017 Tobias Thierer <tobiast@google.com> Improve Android-changed documentation for removal of ZoneInfo

This CL adds documentation for previously undocumented Android
changes in AbstractCalendar, and makes the change comments
consistent.

sun.util.calendar.ZoneInfo appears to never have been available on Android.
Libcore commit 9c853c5b9ebbb0ef60a013ae10ee411d70dfa832 back in 2015 made
corresponding Android changes to the OpenJDK code that was ported, but
those changes were not documented at the time.

Bug: 35910877
Test: Treehugger build succeeds.

Change-Id: I4842885ebb5a0272f545cea459413155fb98e6dc
alendar.java
apaneseImperialCalendar.java
a82a725128fdf30479899ef2e7c1c077c0d5e97e 20-Apr-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Fix typo in java.util.Locale ICU data information" am: 6bb8bfac83 am: 66c34176ef
am: 79cf16d002

Change-Id: Id93173d65e0f103a865d3cbdf5aea9221af874f1
9926b18090f9972a90b0281fb38a200ec5f11290 20-Apr-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix typo in java.util.Locale ICU data information

No idea whether O is going to be 8.0, removed number from table.

Test: make docs
Bug: 34681748
Change-Id: I3ed20ef36dd36df81c2413b78895eb1b2bc1d5dd
ocale.java
33a4c8a12c730c1df297e4896871b14587c8c442 20-Apr-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Update java.util.Locale ICU data information" am: 92258e7023 am: b17985688d
am: b9d8a1027d

Change-Id: I0bfc266ca19e243d2f0dc9abcdf220ebb65106f7
fa483de885b9048b2c165d9e87bc10dc2fb7e205 14-Mar-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Update java.util.Locale ICU data information

Test: make docs
Bug: 34681748
Change-Id: I3d2c15836ad44b7838529523bd4f327b1c84acff
ocale.java
fadca14b466aae95baea75d5dca7491deffbd7d6 18-Apr-2017 Tobias Thierer <tobiast@google.com> Merge changes Ib35bb121,I9903fc50 am: decb673fdb am: 19eb129777
am: 39c8ee4cce

Change-Id: I536d03ea4b90b3b546e8b17e0209f6cbc38ca3c6
decb673fdbd066ae760a77da00684d3e5b0f07f0 18-Apr-2017 Tobias Thierer <tobiast@google.com> Merge changes Ib35bb121,I9903fc50

* changes:
Ensure all ojluni Android-changed comments occur in line comments.
Further canonicalized Android-changed comments
9eca269fb2932fb9fd99b6e898600e7a21ade0e0 12-Apr-2017 Tobias Thierer <tobiast@google.com> Ensure all ojluni Android-changed comments occur in line comments.

This brings the comments closer to the style guide and allows
automated extraction of the comment body.

After this CL, every occurence of "Android-" in a ojluni .java file
is in a line that contains a match for the regexp pattern:

"// (BEGIN |END |)Android-(?:changed|added|removed|note)(?:(?:: )?(.*))$"

Most of the previous violations of this rule were block comments that
should have been line comments (per the style guide), but there were
also some other occurence such as a reference to some other
"(Android-removed)" parts in prose, which was changed to
"(Android removed)".

There was a mix of:
Android-removed: this debugging mechanism is not used in Android.
Android-removed: this debugging mechanism is not used in Android
Android-removed: this debugging mechanism is not supported in Android.

comments that were all normalized to:

// Android-removed: this debugging mechanism is not used in Android.

Test: Treehugger build succeeds
Test: Script (unsubmitted) does not find any occurences of "Android-"
in ojluni .java files that do not match the above regex Pattern.
Bug: 35841464

Change-Id: Ib35bb1215d1fc29e82ba0a12f32c86423c737173
rrayList.java
rrays.java
ollections.java
inkedHashMap.java
esourceBundle.java
c95fd2741ce6120a4f9a76fa347df520653efa50 12-Apr-2017 Joachim Sauer <jsauer@google.com> Merge changes from topic 'tznames_cache' am: e8e19d01bc am: f931c31407
am: a28472ba92

Change-Id: Ic03f173b4ee33ce9f1aabe8d338ab8c2957ec8d6
de283414f204358be778468d6081097a4b721cdc 12-Apr-2017 Tobias Thierer <tobiast@google.com> Further canonicalized Android-changed comments

Fixed up two typos and rephrased one occurence of "Android-only",
since the intention of the style guide is for the substring "Android-"
to only occur in documentation for Android changes

After this CL, the only occurences of the substring "Android-"
in ojluni .java files are in lines that contain a match for the
regex pattern

"Android-(?:changed|added|removed|note)(?:(?:: )?(.*))$"

Test: Treehugger build succeeds
Test: Verified via (unsubmitted) tool that the above statement
about lines that contain "Android-" holds.
Bug: 35841464

Change-Id: I9903fc50ab2af2b4b16cd317e42aa4dc3b28641a
MLUtils.java
ogging/Level.java
e8e19d01bc66f2feaf26fb839ec2d91f9077921d 12-Apr-2017 Joachim Sauer <jsauer@google.com> Merge changes from topic 'tznames_cache'

* changes:
Generating GMT offset Strings in TimeZoneNames
Don't pre populate TimeZoneNames cache.
Change TimeZone.getDisplayName() to use ICU4J
c7d1dedeae2837df17ffdc9d0d62730995ccce67 24-Mar-2017 Joachim Sauer <jsauer@google.com> Change TimeZone.getDisplayName() to use ICU4J

TimeZone.getDisplayName() is one of the two remaining users of
libcore.icu.TimeZoneNames. We want to limit the use of that class in
favor of using ICU4J functionality directly.

This commit changes getDisplayName() to use
android.icu.text.TimeZoneNames instead.

Coincidentally this also fixes a bug where non-canonical time zone IDs
would never get a proper formatted name (they would return GMT+XX:XX
format strings instead).

Bug: 33259649
Bug: 33197219
Test: run cts -m CstLibcoreTestCases
Change-Id: I1e8b3adf3e723752515a1b5a262f9060a84ac69d
imeZone.java
dba22572b81e24b5ec9c427fac49e07ae9f86eb4 12-Apr-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Document javadoc removals in java.util.Optional*" am: b48904f7eb am: d62bb1b764
am: af44731136

Change-Id: I4b1da118d2ffa3247ca2c3e337d8cde443aaf817
7c6843e605b6224539b84a2d57a657668739295f 11-Apr-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Document javadoc removals in java.util.Optional*

This change adds android-removed markers for javadoc removals in
libcore commit b0576a2458c789126957917d8d9cf2a58ec6762a

Test: make -j 32
Bug: 35990383
Change-Id: I2e25ecdeee1183b96a203c1591ebe2f732957520
ptional.java
ptionalDouble.java
ptionalInt.java
ptionalLong.java
4a32579cf2cd8e80ce73ca30b0647d03e7e492b1 05-Apr-2017 Joachim Sauer <jsauer@google.com> Merge "Remove out-of-date comments about ICU4C." am: 6c33d54046 am: 72b0f74f5d
am: 297f710778

Change-Id: I17c94cf5a19f357d182546e3069f01603ca3c9f3
85efcadc9f9361a2c9b704caee4ba8585c633e64 24-Mar-2017 Joachim Sauer <jsauer@google.com> Remove out-of-date comments about ICU4C.

There are comments about ICU4C using wrong timezone data spread
throughout the relevant code. These comments are now no longer
applicable, for two major reasons:

- ICU (both ICU4C and ICU4J) now uses timezone data that is in sync with
the rest of the system. A fact that's even explicitly tested in a CTS
test.
- The relevant ICU4C calls no longer generate GMT+XX:XX strings, but
only return time zone names when present, so ICU4C generating them
wrong is no longer an issue.

Test: m checkbuild
Change-Id: I361d2317d08b70461b3d1d019427005267e36269
imeZone.java
22aa3d601e3aa3d844a117fb49e31a93fe79aa88 04-Apr-2017 Narayan Kamath <narayan@google.com> Merge "Revert "Revert "Matcher: Avoid excessive String copies.""" am: 99e7af0a2f am: 4c585da0b1
am: 6f9b4e05c1

Change-Id: Ibd92c282800b1ebed4b912b4d539fe48561d0d57
9084fb6f7c4da5d42c6b58b523d71e8ad65dd754 04-Apr-2017 Narayan Kamath <narayan@google.com> Revert "Revert "Matcher: Avoid excessive String copies.""

This reverts commit 53e4e15bb0fc2f789274998f3ce62c4fc021fbe8.

Fixes a memory leak introduced in 53e4e15bb0f. Also :
- switches to using ScopedStringChars to simplify the code further.
- better ICU error checking.

Bug: 36366255
Bug: 36818684

Test: cts -m CtsLibcoreTestCases
Test: ScannerTest on host/x86
Change-Id: I3f108931cd5236be4ff9c0bd608a87701370dbf1
egex/Matcher.java
a0ec5d4909d37222f4ae2547909db8078193c7b1 04-Apr-2017 Narayan Kamath <narayan@google.com> Merge "Revert "Matcher: Avoid excessive String copies."" am: 19e7bbfa1f am: de737ffc52
am: deb28eafcc

Change-Id: Ic4ae8e638a666792658a1edd3540f1b239e7d6eb
19e7bbfa1fd6bc558a4062ae38b96a1581462a1b 04-Apr-2017 Narayan Kamath <narayan@google.com> Merge "Revert "Matcher: Avoid excessive String copies.""
53e4e15bb0fc2f789274998f3ce62c4fc021fbe8 03-Apr-2017 Narayan Kamath <narayan@google.com> Revert "Matcher: Avoid excessive String copies."

This reverts commit 903563600f39b4efdf22a179f0d270e4d2a72469.

Reason for revert: this results in sporadic crashes on
host/x86.

Change-Id: Ibb914b298df0e814a8684904b118fbaa8b8cab2c
bug: 36366255
egex/Matcher.java
febff4c78d1a0dc46dd96b481feda455a7634630 03-Apr-2017 Narayan Kamath <narayan@google.com> Merge "Matcher: Avoid excessive String copies." am: f69b674ee4 am: 92c15a8060
am: df6f49c8be

Change-Id: I0c546124d515610dafd33924463a100d0e920aa6
f69b674ee446e665f7b6c38fc6e61dae3aa77248 03-Apr-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Matcher: Avoid excessive String copies."
903563600f39b4efdf22a179f0d270e4d2a72469 24-Mar-2017 Narayan Kamath <narayan@google.com> Matcher: Avoid excessive String copies.

We avoid calls to GetStringChars on every JNI call to find or findNext.
Given that we now have a moving collector, we always copy on GetStringChars.
Moreover, on Android O, we incur the cost of these copies even if the
String in question is in a non-moveable space because the String might
be compressed. The cost of these calls can quickly add up, especially
for the case where the pattern in question occurs several times in the
string.

Relevant benchmark results are included below. This shows that for a
String size of 64kb with near worst case repetition of patterns, the new
implementation takes ~1/100th the time (8ms vs 737ms)

BEFORE:
Experiment {instrument=runtime, benchmarkMethod=timeReplaceAllTrivialPatternSingleOccurence, vm=default, parameters={s=NON_MOVEABLE}}
runtime(ns): min=1832194.71, 1st qu.=1865190.38, median=1918799.21, mean=1951987.04, 3rd qu.=2032988.61, max=2171749.44
Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_256}}
runtime(ns): min=91264.94, 1st qu.=91999.01, median=92500.85, mean=92864.29, 3rd qu.=94001.42, max=94304.77
Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_1024}}
runtime(ns): min=460049.96, 1st qu.=464198.96, median=473150.38, mean=477171.31, 3rd qu.=489764.60, max=508391.29
Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=NON_MOVEABLE}}
runtime(ns): min=736209191.00, 1st qu.=736360924.50, median=737412847.00, mean=737419384.78, 3rd qu.=738278240.00, max=738760545.00

AFTER:
Experiment {instrument=runtime, benchmarkMethod=timeReplaceAllTrivialPatternSingleOccurence, vm=default, parameters={s=NON_MOVEABLE}}
runtime(ns): min=1518890.99, 1st qu.=1528913.92, median=1637897.87, mean=1626845.46, 3rd qu.=1712046.38, max=1750239.83
Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_256}}
runtime(ns): min=61491.55, 1st qu.=62453.80, median=63083.26, mean=63023.21, 3rd qu.=63730.98, max=64245.10
Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=MOVEABLE_1024}}
runtime(ns): min=175484.27, 1st qu.=176039.91, median=177751.78, mean=179295.87, 3rd qu.=183334.40, max=187095.50
Experiment {instrument=runtime, benchmarkMethod=timeReplaceTrivialPatternAllRepeated, vm=default, parameters={s=NON_MOVEABLE}}
runtime(ns): min=8268762.61, 1st qu.=8396197.28, median=8662951.07, mean=8596467.31, 3rd qu.=8731159.36, max=8973943.49

bug: 36366255
bug: 36818684
Test: cts -m CtsLibcoreTestCases
Test: benchmark

Change-Id: Iff07cf2c2ebe89f04289bfa92bcd2469fec349e7
egex/Matcher.java
6e0f325418f2c7aa304d1f26178b064d199cfd95 31-Mar-2017 Tobias Thierer <tobiast@google.com> Merge "Hashtable: Use upstream OpenJDK8u121-b13 versions of Map default methods" am: 8eeca7b925 am: 4388f7e47d
am: c250ceca99

Change-Id: I450df92ef98cd49e74662bc1fc2d6c2897cff0c0
8eeca7b92505ee73b1feb0e4a97c12df8b4b789e 31-Mar-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Hashtable: Use upstream OpenJDK8u121-b13 versions of Map default methods"
365b46d1c0cd136cd655d6851da0ac448c9275b9 29-Mar-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "java.util.regex javadoc chages from openJdk8u121" am: 1e748c9b99 am: 01d961fc6d
am: aeaf263381

Change-Id: Ic1c058b7fa104eb42c955cee5b59f2930636e192
8510e5234e7f0bda32cf4507e679ca856c6040b5 28-Mar-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> java.util.regex javadoc chages from openJdk8u121

Test: make -j 32
Bug: 36461944
Change-Id: I85ab28f2a7629c450ee6cee614dd25ed77a00123
egex/MatchResult.java
egex/Matcher.java
09aaac1c0672a4ec0b896b7e15c6a00d10e26b60 03-Mar-2017 Tobias Thierer <tobiast@google.com> 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
ashtable.java
e841673ad9507e5a8616ba3afc5cbf8caab9c45e 14-Mar-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Remove dead native2ascii links from Properties class." am: 6bc30d3e2c am: f18d52d8c5
am: 74a7efaf6a

Change-Id: Ibb05e575c87dc92bf822e26b28e44b19fd23bf3d
b6f2415cc673d67ac62c31a74a352723bbec9cf3 10-Mar-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove dead native2ascii links from Properties class.

Bug: 36025251
Test: make docs
Change-Id: I5756a868cdfa02eff01faa47eb1420d7abc29905
roperties.java
1b3f6d3b21841c61c075153002fed60fa959954f 07-Mar-2017 Tobias Thierer <tobiast@google.com> Merge "Tweak java.util classes to minimize diffs vs. upstream" am: 0182708222 am: c67393f531
am: de4c80346b

Change-Id: Ic4b880f7c0e615e953891a737a521b95d8f86c64
31d7ad46db62a671387ce0428cc56454225e4245 07-Mar-2017 Tobias Thierer <tobiast@google.com> Merge "Misc tweaks to Android-changed documentation in java.util" am: dec0611dbe am: ce16f015c9
am: c4066e1260

Change-Id: I8651dcb14c57c8f42a1f8dabf3190637741be798
4dd96f841940200574fc8b095213347b79068728 06-Mar-2017 Tobias Thierer <tobiast@google.com> Merge "Make Android patch docs in ojluni more consistent with style guide" am: 82d023e83b am: 0874754b17
am: 4d9cfc56e4

Change-Id: Idc3029e1bb5e8b21c7d431110f26d8fd04a4dbfb
1d70b849467dfcfa30f495e6d03bcbdef47b2588 03-Mar-2017 Tobias Thierer <tobiast@google.com> Tweak java.util classes to minimize diffs vs. upstream

All of these changes are minor. They fix minor needless
differences vs. upstream code. Some tweaks to Android-changed
documentation were also made.

"upstream" means OpenJDK8u121-b13, except for AbstractQueue,
whose upstream is the same as in http://r.android.com/316686
(a commit between jdk-9+113 and jdk-9+114).

- AbstractMap:
- Minor whitespace changes.
- AbstractQueue:
- Minor whitespace changes.
- Tweaks to Android-changed docs.
- Arrays:
- tweak to rangeCheck() argument name and docs,
missed in the update to OpenJDK8u60
- Tweaks to Android-changed docs.
- Base64:
- avoid integer overflow, missed in the update
to OpenJDK8u121-b13.
- EnumMap:
- Fixed copyright year change, missed in the
update to OpenJDK8u60.
- Minor whitespace change.
- Hashtable:
- Tweaks to Android-changed docs.
- Minor whitespace changes.
- List:
- Removed empty documentation line.
- TreeMap:
- Dropped redundant "= null" initialization,
consistent with upstream OpenJDK8u60 (this line
still differs from upstream because of the rename
Entry -> TreeMapEntry).
- Tweaks to Android-changed docs.
- Vector:
- Minor whitespace change.

Bug: 35910877
Test: CtsLibcoreTestCases

Change-Id: Iaff5c5130e4ff32cbb28677d2fb8715d75d08a5e
bstractMap.java
bstractQueue.java
rrays.java
ase64.java
numMap.java
ashtable.java
ist.java
reeMap.java
ector.java
aa3cc81fcb0d35faa9a51d6bf59d48685fd4d16a 03-Mar-2017 Tobias Thierer <tobiast@google.com> Misc tweaks to Android-changed documentation in java.util

Makes Android-changed documentation in java.util more
consistent with the style guide.

This CL contains no behavior changes.

Test: make droid cts
Bug: 35841464
Change-Id: If0fac577b90d77bc5ff86b784d4b9fa5ef1c5a8a
rrayList.java
alendar.java
ollections.java
urrency.java
ate.java
eque.java
inkedHashMap.java
ocale.java
ap.java
bservable.java
erviceLoader.java
reeMap.java
6975f84c2ed72e1e26d20190b6f318718c849008 01-Mar-2017 Tobias Thierer <tobiast@google.com> Make Android patch docs in ojluni more consistent with style guide

This CL consists of an automated and a manual part (originally
reviewed as separate CLs, then squashed together before submitting
in order to minimize the number of times each Android-changed line
is touch, since that makes future git archaeology on these simpler).

Automated part: Run the following command (performs regex replacements):

find ojluni -name \*\.java | xargs sed -i \
-e 's/Android[- ]changed/Android-changed/ig' \
-e 's/Android-changed :/Android-changed:/g' \
-e 's/Android-changed \(BEGIN\|END\)/\1 Android-changed/g' \
-e 's/Android-changed - /Android-changed: /g' \
-e 's/Android[- ]removed/Android-removed/ig' \
-e 's/Android-removed :/Android-removed:/g' \
-e 's/Android-removed \(BEGIN\|END\)/\1 Android-removed/g' \
-e 's/Android-removed - /Android-removed: /g' \
-e 's/Android[- ]added/Android-added/ig' \
-e 's/Android-added :/Android-added:/g' \
-e 's/Android-added \(BEGIN\|END\)/\1 Android-added/g' \
-e 's/Android-added - /Android-added: /g' \
-e 's/----- \(BEGIN\|END\) android\( -----\)\?/\1 Android-changed/g' \
-e 's/\/\* \(BEGIN\|END\) Android-changed \*\//\/\/ \1 Android-changed/g'

Manual part: Move BEGIN Android-* lines out of block comments

Some Android-{changed,removed,added} lines occurred inside block comments.
This CL targets places in ojluni that contained the String "* BEGIN Android-"

Changes made by this CL include:

- Move the "BEGIN Android-" line into a line comment (the style guide
mandates that "Android-" lines are always in line comments). In many
cases, that line comment is immediately followed by a block comment
holding commented-out upstream code.
- Add corresponding "// END Android-" line comments, where missing.
- Drop documented import changes altogether. These create noise for
little benefit:
(1.) Most import problems will be found at compile time
(2.) They generally correspond to documented changes elsewhere in
the file.
- In most cases, the phrasing of comments and the decision whether to
keep commented out upstream code was not changed by this CL.
- Some additional tweaks were made in line with the style guide.

No attempt was made to:

- Verify that commented-out upstream code actually matches the
current upstream.
- Make any fixes (eg. to comments) that would have required
git archaeology (looking up historic commits).

Bug: 35841464
Test: make droid cts update-api

Change-Id: Ibc60979cb6061cfb0e9c7096cc9dcab30ddfa733
rrayList.java
rrays.java
alendar.java
urrency.java
ate.java
ormatter.java
regorianCalendar.java
ashtable.java
apaneseImperialCalendar.java
inkedHashMap.java
ocale.java
canner.java
erviceLoader.java
imeZone.java
reeMap.java
ector.java
oncurrent/CompletableFuture.java
oncurrent/ConcurrentHashMap.java
oncurrent/Exchanger.java
oncurrent/Executors.java
oncurrent/ForkJoinPool.java
oncurrent/ForkJoinTask.java
oncurrent/atomic/AtomicIntegerFieldUpdater.java
oncurrent/atomic/AtomicLongFieldUpdater.java
oncurrent/atomic/AtomicReferenceFieldUpdater.java
oncurrent/atomic/Striped64.java
ar/JarVerifier.java
ar/Pack200.java
ogging/LogManager.java
ogging/LoggingMXBean.java
refs/FileSystemPreferences.java
refs/XmlSupport.java
ip/DeflaterInputStream.java
ip/Inflater.java
ip/InflaterInputStream.java
ip/ZipFile.java
ip/ZipInputStream.java
b7994dcff671c988691832a82e06f785ff6ea916 16-Feb-2017 Tobias Thierer <tobiast@google.com> Merge "Clarify Android changes to Formatter, GregorianCalendar" am: 5d3b400b76 am: 448473a05c am: bde4006847
am: f4b6bf04f0

Change-Id: Ia73854c318af4ba602090388a9bab866ed8fdd58
24c53a983bd88d9e347716d88bd90ff378f94572 16-Feb-2017 Tobias Thierer <tobiast@google.com> Merge "Document Android changes/additions vs. upstream in Calendar.java" am: ac74ec8418 am: 0982e362b8 am: 471704a07a
am: c521d24e4a

Change-Id: I4ea975515b2db223c6bfee302af9a09eabe22f28
5d3b400b7647509581b6c7f6f2d31a4465ef4af5 16-Feb-2017 Tobias Thierer <tobiast@google.com> Merge "Clarify Android changes to Formatter, GregorianCalendar"
ac74ec84181ae535672fe29747d07d18737a0fae 16-Feb-2017 Tobias Thierer <tobiast@google.com> Merge "Document Android changes/additions vs. upstream in Calendar.java"
0c3ff19908dde61846673021da243c9dddaa4105 15-Feb-2017 Tobias Thierer <tobiast@google.com> Clarify Android changes to Formatter, GregorianCalendar

Minor clarifications to extent and nature of Android changes
through use of BEGIN/END lines and (in case of small changes)
commented out upstream code.

Also fixed the copyright year in GregorianCalendar to be
consistent with upstream.

Test: Treehugger build succeeds.

Change-Id: I2888390c746235012dd722769b251828ec00b1bc
ormatter.java
regorianCalendar.java
636db3a4926f49960619ac7e2fd43da10485c2f8 15-Feb-2017 Andreas Gampe <agampe@google.com> Merge "Libcore: Restore Locale modifications" am: a6d19dfcc4 am: a0f7bdbbc5 am: d6d6f6ce5a
am: 6321177ed9

Change-Id: Ied3bc9f843275145050fe4c3af42d4b56183b4e3
21c40e1463c0026f5df4faa5b17cb34ed4ec267c 15-Feb-2017 Tobias Thierer <tobiast@google.com> Document Android changes/additions vs. upstream in Calendar.java

- Add missing comments for Android additions/changes
- Clarify the extent of changes with existing comments by
introducing BEGIN/END lines.
- Fix typo in Android-added @hide method name
getJapanesImperialInstance()

Consideration whether each change is correct or should be upstreamed
is not part of this CL.

Bug: 35235723

Test: make droid cts

Change-Id: I5fa9565162b62c1d4ce51875c7b83a000ef1b289
alendar.java
6d65625ab80fefa3a01b4daa89f598109647e295 15-Feb-2017 Andreas Gampe <agampe@google.com> Libcore: Restore Locale modifications

Restore Android modifications to make Locale compile-time
initializable.

Bug: 34956610
Test: m
Test: Device boots
Change-Id: Iab94447bbd5c32b442a3d3d74cb912f4ca8cfe51
ocale.java
dad4456bc4107d7966982b599ef8f70ffd079a9b 14-Feb-2017 Neil Fuller <nfuller@google.com> Merge "Revert "Revert "Add unit tests to Calendar.Builder.""" am: 056ea27505 am: 573e19f039 am: 4bcc21023e
am: 17b82cc3e7

Change-Id: I5d0e22d46a92116b3e71df8bb39069b520b95b84
056ea27505db62ac862f3d92f55211fa970b04c6 14-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Revert "Revert "Add unit tests to Calendar.Builder."""
ca09f396de0e27f72cd66683e7db8941dc1c97e2 14-Feb-2017 Neil Fuller <nfuller@google.com> Revert "Revert "Add unit tests to Calendar.Builder.""

This reverts commit 818caf98f0b396b56bef2d6ec05d718bfb6b5f71.

Change-Id: I8bdef684aa13614aa4e332fd7437cf19ad47594b
alendar.java
be1462fdda0cb9b34bebe758a367a5177d940b0d 14-Feb-2017 Tobias Thierer <tobiast@google.com> Merge "Revert "Add unit tests to Calendar.Builder."" am: 5f183d0fcd am: bcfeb6aabc am: 9e79d31b41
am: 782fbe1d48

Change-Id: I480889db33b22a3e121a071afeafbd94b3dd6dd3
5f183d0fcd12f774815c92277d5cf5caa46d85f5 14-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Revert "Add unit tests to Calendar.Builder.""
818caf98f0b396b56bef2d6ec05d718bfb6b5f71 13-Feb-2017 Tobias Thierer <tobiast@google.com> Revert "Add unit tests to Calendar.Builder."

Pushed core-tests over dex's 64k method limit. Reverting temporarily as a workaround to get the automated tests running until we can fix the root cause.

Bug: http://b/35308152
Test: Treehugger builds successfully.

This reverts commit 07f8657dec162314b50f8ba7d7bf656916e870b7.

Change-Id: Ie2fda27582c9b69baea3515bdf703f229a78e5b4
alendar.java
5d57f9ba6b61f29406aac5235fe92bc3d2efbd97 13-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Javadoc fixes" am: 96ca0c8459 am: 1126b9c948 am: 20e62c2d6e
am: 8d4bf6d2ae

Change-Id: If65e74379310fab8b5876c2e8d71790e84f2088f
96ca0c84595c932e4d4d4304249dde6449df1489 13-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Javadoc fixes"
c27448932466a7407136fa7aaf2c5c9071c3c99d 13-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Fix hashtable serialization capacity" am: b5cef9f0ba am: b04a3b4517 am: d895b8b01c
am: dc643148fb

Change-Id: I8108493efe34a67cfb1e981ce1cf06ef4a63269c
b5cef9f0ba17c0e6739f46e2c5a67f19b4960878 13-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Fix hashtable serialization capacity"
8906f5f878ec269b3c100a96e74f996c70352c97 13-Feb-2017 Joachim Sauer <jsauer@google.com> Merge "Add unit tests to Calendar.Builder." am: 543ae18600 am: a88c52ad46 am: d79451504f
am: f7de30be74

Change-Id: Ib08afbd38f87f0f01d0cd47e8efadd0e77197162
844ecee481997dba621863ddc749aa2dcf0cb139 07-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix hashtable serialization capacity

Ported from openjdk8u121

changeset: 11513:cb701a5bd82c
user: plevart
date: Wed Jan 21 21:42:22 2015 +0100
summary: 8068427: Hashtable deserialization reconstitutes table with wrong capacity

Test: CtsLibcoreTestCases
Bug: 31028374
Change-Id: I8793346ade742b123b91ce79e5ab3d84e4cab82f
ashtable.java
07f8657dec162314b50f8ba7d7bf656916e870b7 10-Feb-2017 Joachim Sauer <jsauer@google.com> Add unit tests to Calendar.Builder.

Also fixes a bug where Calendar.Builder for the th_TH locale would throw
an unexpected exception and fixes a typo in a JavaDoc example.

Bug: 34923731
Test: run cts -m CtsLibcoreTestCases
Change-Id: I8ab65535a807eee6898b19fe2747935df31a0a32
alendar.java
b63c84ec30dba9a221ff99a18d91bec3aec29245 10-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Standardize logging levels" am: ebedf42383 am: 76a2f08279 am: a3bc533829
am: 3e98af7de8

Change-Id: If2a69d8da1c2733923df26b823500590daccca79
ebedf423835052cf5b7069000da969a1ce9d2734 10-Feb-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Standardize logging levels"
1d3a3b7676bc344c9daf25285d19f86b3b6c946a 10-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Javadoc fixes

Ported from openjdk8u121

changeset: 11449:11a8193dfa30
user: dfuchs
date: Wed Mar 02 11:14:35 2016 +0100
summary: 8148820: Missing @since Javadoc tag in Logger.log(Level, Supplier)

changeset: 11280:b6d732a87fc5
user: psandoz
date: Wed Jan 21 09:46:24 2015 +0000
summary: 8062901: Iterators is spelled incorrectly in the Javadoc for Spliterator

changeset: 11914:7f169fa54a10
user: rpatil
date: Wed Oct 12 16:29:59 2016 +0530
summary: 8166875: (tz) Support tzdata2016g

changeset: 11022:6cd4ceeb2f05
user: igerasim
date: Tue Aug 25 19:45:07 2015 +0300
summary: 8134356: {@code} tag contains &lt; and &gt; sequences

Test: CtsLibcoreTestCases
Bug: 31028374
Change-Id: Ie48fa6d5fb6d629a624492c499a40a0ef96bde8b
pliterator.java
ogging/Logger.java
09f716b14eec1bd09a88753aeb310ac5ad060785 10-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Add synchronized to Deflater.needsInput()" am: 111a30eb86 am: 39d3b13e07 am: 733c2e0275
am: 79807e3cb3

Change-Id: Iaa34303e1db5f89caa850679be98f3ce6cbe99cc
111a30eb86a4f03aa66494850ea1e4d4e81f386a 10-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Add synchronized to Deflater.needsInput()"
1cfadde2152806a52c5c7e68d0d028160d89edc7 07-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Standardize logging levels

Ported from openjdk8u121

changeset: 12094:684fa25fc7eb
user: dfuchs
date: Thu Aug 11 14:16:21 2016 +0100
summary: 8162577: Standardize logging levels

Test: CtsLibcoreTestCases
Bug: 31028374
Change-Id: I115a9db940477752d0c2ce2bb3327fdeef73f3bc
ogging/Level.java
ogging/LogRecord.java
2a10fb51b4012e0cb08adab0b632845a8c50fc32 06-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add synchronized to Deflater.needsInput()

Ported from openjdk8u121

changeset: 11054:c982997a738b
user: coffeys
date: Thu Oct 15 14:41:37 2015 +0100
summary: 8038502: Deflater.needsInput() should use synchronization

Test: CtsLibcoreTestCases
Bug: 31028374
Change-Id: I9c480bab4a35ec3f6bd431bc5ccdd5ff7e39440d
ip/Deflater.java
c39d2c15ef31e3796862acb859c0119519fead47 07-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "java.util.zip Thread safety fixes" am: 185ba0218e am: 71003f2a6c am: a31b8215f2
am: 3e7967ff61

Change-Id: I94b1927b628a1b542ea87585a60c1f851f2ee31b
f325bd787ff60a2021e016eb29ac8f46184e2dd8 07-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "AbstractMap.keySet and .values should not be volatile" am: 2f93a90371 am: 8e05fb8d2c am: a8a4512738
am: 0290cc430d

Change-Id: I4d1a0cc1569ec1b4c40241fb9fd50dde295c200b
185ba0218e4f70b95184f20534a7d49218e4b2b4 07-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "java.util.zip Thread safety fixes"
15a062b16485b913fbca72ce5ebafb9e16aab284 06-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> AbstractMap.keySet and .values should not be volatile

Ported from openjdk8u121

changeset: 11261:6c1cb8f35b16
user: shade
date: Thu Dec 17 21:14:58 2015 +0300
summary: 8145539: (coll) AbstractMap.keySet and .values should not be volatile

More infocab be found here:
https://bugs.openjdk.java.net/browse/JDK-8145539

Test: CtsLibcoreTestCases
Bug: 31028374
Change-Id: I1a9a2c31268336f4922ef6ab692b6e7f84e706c2
bstractMap.java
numMap.java
ashMap.java
dentityHashMap.java
inkedHashMap.java
reeMap.java
eakHashMap.java
5618a1b5167db9fb4578c7b54b6234b95cca1f53 03-Feb-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> java.util.zip Thread safety fixes

Ported from openjdk8u112

changeset: 11053:9ad796b3ce4d
user: coffeys
date: Thu Oct 15 09:33:03 2015 +0100
summary: 6907252: ZipFileInputStream Not Thread-Safe

changeset: 11052:9e7d9568678d
user: robm
date: Sat Oct 17 21:55:25 2015 +0100
summary: 8133249: Occasional SIGSEGV: non thread-safe use of strerr in get LastErrorString

Test: CtsLibcoreTestCases
Bug: 31028374
Change-Id: I763f2863f4f492660211f9d8a8667156690de6c8
ip/ZStreamRef.java
ip/ZipFile.java
c06d841364ae5a40828ca93adc6fc061bbf5e9ff 30-Jan-2017 Joachim Sauer <jsauer@google.com> Update java.util.Formatter to 8u60. am: 4ed824ce20 am: 0b7be63c75 am: 3cdfb5054b
am: 78ac2dbc94

Change-Id: Ic43dd644e47ca13f6aa001671a2a6cadc228a62b
f18c25a1a00f3ff5319727884d0d3319bca2fc4f 30-Jan-2017 Joachim Sauer <jsauer@google.com> Improve CalendarDataUtils. am: dc4414b90a am: 8dffe25c7c am: 77ac9e0fd8
am: ef9ae54117

Change-Id: Id9f4bb757e4afd554f6b60961ac82470227686c5
4ed824ce20b8e732696f63224d9ebea04ed3eea2 21-Dec-2016 Joachim Sauer <jsauer@google.com> Update java.util.Formatter to 8u60.

The main change is that it now supports formatting of java.time types.

- Adapt relevant test to Android sepcifics.
- Add Android-changed comments where appropriate
- Removed unused mantissa() and exponent() methods

Bug: 28832222
Test: run cts -m CtsLibcoreOjTestCases
Change-Id: I8a5de3f4bd39b6bad09850d4e5329a54331a2315
ormatter.java
dc4414b90a99639a0701c321472e29200b7ae0a0 24-Nov-2016 Joachim Sauer <jsauer@google.com> Improve CalendarDataUtils.

Support ALL_STYLES which is used for parsing when no specific style is
required.

Don't return a Map for fields where names are ambiguous (mostly happens
when the style is NARROW).

Allow getDisplayName() to be used with ALL_STYLES as an alias to SHORT.

Modify CalendarTest to allow getDisplayNames with ALL_STYLES to return
more values than SHORT and LONG together (due to narrow styles).

Bug: 28832222
Test: artrun testng-time.xml
Test: CtsLibcoreTestCases
Change-Id: Iebde1c442380e7359af8dc369906092861b845cf
alendar.java
f75d69eeaba3bcb314d43e166ccb89dc4b9a058a 25-Jan-2017 Joachim Sauer <jsauer@google.com> Fix Japanese Chronology. am: 3866c08053 am: f354cfbf9e am: 9ae7a3bb0d
am: 346b12dc92

Change-Id: I67290334b9deb8db8074f6979ec851e45c7e257b
f354cfbf9ecf9cdf4439bbc9aee23c31b994d12e 25-Jan-2017 Joachim Sauer <jsauer@google.com> Fix Japanese Chronology.
am: 3866c08053

Change-Id: I2df5326d09b9a27a2baac64f33740b9d77cdcd84
5491ccf4d1f20254b5b88cfb5aee307df46b02f8 25-Jan-2017 Joachim Sauer <jsauer@google.com> Merge changes from topic 'java_time_part2'

* changes:
Fix various test failures.
Fix Japanese Chronology.
Support looking up field value names.
Change time zone tests to respect Android changes.
Use ICU data for time zone name parsing.
330f36d8c3cc09445f16e68b69456feb247e6451 25-Jan-2017 Tobias Thierer <tobiast@google.com> Un-@hide Collections static factories that are now tested. am: 64a91fed2c am: ade8fb51cf am: 005a562c1d
am: b43f583c56

Change-Id: Ibe90d17fb3a54a808f8dacc540f99c1949dbadb1
64a91fed2c53ffbf6ee551b3444bfbceb7887b8f 13-Dec-2016 Tobias Thierer <tobiast@google.com> Un-@hide Collections static factories that are now tested.

Bug: 29935305
Bug: 31896176
Test: CtsLibcoreTestCases

Change-Id: I2221ffe15ceb1477782198d26ca2f708bc0a09a8
ollections.java
3866c080537c37ff7bd246b8d7b1651cd83a07c3 21-Nov-2016 Joachim Sauer <jsauer@google.com> Fix Japanese Chronology.

The JapaneseChronology class depends on the ImperialJapaneseCalendar
being returned by Calendard.getInstance(). Since Android always returns
a GregorianCalendar from that class, the tests will fail.

This fixes the problem by importing the JapaneseImperialCalendar class
from the OpenJDK (with minor tweaks to remove mentions of the ZoneInfo
class) and adapting the relevant classes to use a new explicit method on
Calendar to request such a calendar instance.

Also apply update LocaleGregorianCalendar to jdk8u60 which fixes an
off-by-one error in calculations related to eras.

Added ChronologyDisplayNameTest to ensure future Chronologies return
sane values for their display name and their eras display names.

Bug: 28832222
Test: artrun testng-time.xml
Test: run cts -m CtsLibcoreTestCases
Change-Id: I3eb5d4509ad03ee3d736c7926c605f378b56d0b2
alendar.java
apaneseImperialCalendar.java
0beab9f08d4e124c9519e6df7a00ac81254695a6 19-Jan-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Update java.util.logging to openJdk8u60" am: 64ed273743 am: d0fcbdd150 am: 60bda3d47e
am: ae96e05bc3

Change-Id: Ie522ffbe4b8f1b5de008a5b53cb9df5ba81ae9fe
64ed2737437c69743fb7b699b82aabf08b816fa8 19-Jan-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Update java.util.logging to openJdk8u60"
4ff539dbc5a809ef3eacbe2d9f2b97f640b7e9cf 14-Dec-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Update java.util.logging to openJdk8u60

Logger class gained new methods
to operate using java.util.functional.Supplier and ResourceBundle
objects (methods taking ResourceBundle name as string are deprecated).

Minor functional change to Logger: logger level set before
LogManager.addLogger(logger) is kept, and not overwritten by the
value from logger config/properties.

And many many others:

ConsoleHandler:
- Header change, formating fixes
- Extended the javadoc with config examples

FileHandler:
- Header change, formating fixes
- Extended the javadoc with config examples
- Logic for handlinh zombie file left over
by previous execution

Filter:
- Became a FunctionalInterface

Handler:
- Most of private fields is volatile now
- set* methods are synchronized now
- getLevel no longer synchronized (level is volatile)

Level:
- Removed ResourceBundle caching workaround (caching it in ctor
with VMStack.getCallingClassLoader() for its classloader to avoid
using BootClassLoader). Replaced with Thread.currentThread().getContextClassLoader()
in computeLocalizedLevelName.
- localizedLevelName code refactored.

LogManager:

Logger:
- New methods that take Supplier instead of actual data
- ResourceBundle can be set explicitly, through setResourceBundle method
- Deprecated some of logrb methods
- LoggerBoundle class, pair of bundle and its name, replaces string with
bundle name.
- Removed code for old behaciout for resource bundle search
- @exception changed to @throws

LogRecord:
- Header change
- use system class loader to get ResourceBundle

Logging:
- Header change, added generics

LoggingMXBean:
- Header change

LoggingProxyImpl:
- Header change

MemoryHandler:
- Header change & config documentation in class javadoc
- pushLevel is volatile, setter/getter adjusted
- Ctor uses class name to find config propery (previously
was hardcoded to MemoryHandler class name)

SocketHandler:
- Header change & config documentation in class javadoc
- Removed unused fields (portProperty)

SimpleFormater:
- Header change

StreamHandler:
- Header change & config documentation in class javadoc
- Writer field is volatle
- Removed unused fields (manager)
- setEncoding is now synchronized

XMLFormatter
- Header update
- StringBuffer replaced by StringBuilder
- appendISO8601 switch from Date to GregorianCalendar

Test: CtsLibcoreTestCases
Bug: 28666126
Change-Id: Icd815db68e1a25e680a1cbca16328c05e35d322f
ogging/ConsoleHandler.java
ogging/FileHandler.java
ogging/Filter.java
ogging/Handler.java
ogging/Level.java
ogging/LogManager.java
ogging/LogRecord.java
ogging/Logger.java
ogging/Logging.java
ogging/LoggingMXBean.java
ogging/LoggingProxyImpl.java
ogging/MemoryHandler.java
ogging/SimpleFormatter.java
ogging/SocketHandler.java
ogging/StreamHandler.java
ogging/XMLFormatter.java
cf6b610294d418393ffdc3ac67dba9c39dc7fd43 17-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Update java.util.Date to OpenJDK8u60" am: 056f8c1b27 am: 9bb8a788f1 am: ce7a1b744d
am: 30df740e10

Change-Id: I43f24f665cede63728de2781a463f376eabedfa6
30df740e10f2e94fcdba97ca3d0dca6a5fac7161 17-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Update java.util.Date to OpenJDK8u60" am: 056f8c1b27 am: 9bb8a788f1
am: ce7a1b744d

Change-Id: I56b869fa18fd33cd8bb97e75a3346a29d9d39f63
b542c6f2c39acf57fcdf6b78eff481601e9a7f7b 17-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Document incorrect LinkedHashMap Spliterator ordering in Android N."
2485f0b24ad267fa1134dd84b3bb47d3cf9b8d21 06-Sep-2016 Tobias Thierer <tobiast@google.com> Update java.util.Date to OpenJDK8u60

Added two missing Android-changed comments.
Added upstream logic for converting to/from Instant
Added tests for conversion to/from Instant.

The minimum millisecond time (just under a second after
new Date(Long.MIN_VALUE)) that can be converted from
Instant to Date without encountering ArithmeticException
is not clearly documented. A test now ensures that this
boundary value remains consistent; no attempt was made
to change or explain the current boundary value.

Test: CtsLibcoreTestCases
Bug: 29935305

Change-Id: I79aff68ace5157cd3db5b1304651d07999d66796
ate.java
0e6f5a418226d7233896b0c9e33853224a2bb3b7 13-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Compat behavior for Collections.sort()" am: 9861e09b8d am: 68555d2816 am: 3f9e687b5b
am: 0994586817

Change-Id: I1aaf4bed3c166bba5469cfe725706f9f0f393f23
51425d7305cbe85c50c128766d78f351bb9ecb56 13-Jan-2017 Joachim Sauer <jsauer@google.com> Make java.time compile. am: d7928577b0 am: c174935919 am: cd5f73187b
am: eb08876839

Change-Id: I45b5dab59bf86883fa27ec1eece4dc742efd6baa
09945868179b59192e58d1e14612cf0801ea78e7 13-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Compat behavior for Collections.sort()" am: 9861e09b8d am: 68555d2816
am: 3f9e687b5b

Change-Id: I000f6d4f7a5054bc43dbb8e96599019a0e9766bc
eb08876839c6f7af7f7af141c40329bf72ce79c8 13-Jan-2017 Joachim Sauer <jsauer@google.com> Make java.time compile. am: d7928577b0 am: c174935919
am: cd5f73187b

Change-Id: Ib2180a378da67be0b9f4a60fefba627e5e30206b
7ae7ae73754c8b82a2e396098e35553d404c69ef 10-Jan-2017 Tobias Thierer <tobiast@google.com> Document incorrect LinkedHashMap Spliterator ordering in Android N.

Note that in Android N, the Spliterators for LinkedHashMap's
Collection Views did not report the SUBSIZED characteristic;
the Spliterators.spliterator(collection, int) call in the
suggested code snippet implicitly adds that characteristic.

This means that a Spliterator obtained via the suggested code
snippet reports not only a different order but also different
characteristics from the LinkedHashMap's native iterators.
Few applications will care about this subtle difference, and
the new behavior seems to make more sense; therefore, the
documentation does not call out this aspect.

The latest version of LinkedHashMap in AOSP (since [1])
implements its Spliterators via Spliterators.spliterator(),
which means that they do report the SUBSIZED characteristic,
just like the ones obtained via the code snippet in the
documentation added by this CL. Regression tests for the
reported characteristics of these Spliterators will be
submitted to AOSP in a separate CL.

[1] http://r.android.com/255655 (2016-08-16)

Bug: 33945212
Test: make
Test: Verified that the bug exists via guava-testlib-21.0-rc2, code
inspection and via a small new (unsubmitted) test.
Test: Verified via a small new test (unsubmitted) that the code
snippets given in the documentation produce the correct
iteration order.
Test: Verified via a small new test (unsubmitted) that LHM's
Spliterators do not report SUBSIZED before this CL, but
that the Spliterators obtained via the suggested
workaround do. Tested that the characteristics reported
by the Spliterators obtained via the workaround code
match those from LHM in the latest version of AOSP.

(cherry picked from commit 53c8c684093c1778163ed386777e802e8f5188f1)

Change-Id: I07f63a7edaf9195800a54bfb5a3a7fc880cce58a
inkedHashMap.java
9861e09b8d6b7fcf9e7e6eeb3aaa57cb3c751f14 13-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Compat behavior for Collections.sort()"
ffbe99d6c5f0228e25d8821e7ff84e7c54ca38a4 03-Jan-2017 Tobias Thierer <tobiast@google.com> Compat behavior for Collections.sort()

AOSP libcore commit 5ae9d084f85cce06b02f7cee28db87ebe6be5056
changed Collections.sort() to call List.sort() rather than
vice versa. This causes infinite recursions in apps that call
Collections.sort() from List.sort(). (It can also lead to a
behavior difference with respect to modCount). Since popular
such apps exist, this CL guards the new behavior by a
targetSdkVersion check so that only apps targeting (and
running on) API versions > 25 observe the new behavior of
Collections.sort() calling List.sort().

The previous documentation for List.sort() was also
inappropriate since it recommended calling super.sort(),
which will only work on API level 24+ which introduced
that method.

Tests temporarily set appropriate targetSdkVersions.

Bug: 33482884
Bug: 34072201
Test: CtsLibcoreTestCases (includes CollectionsTest)

Change-Id: I57cf18895e1d03cb43ff1c8232a75744fe94b78f
ollections.java
ist.java
d7928577b0cc656c1c6da16bfe281541fdd435ee 13-Oct-2016 Joachim Sauer <jsauer@google.com> Make java.time compile.

This involves several mostly unrelated changes that nontheless don't
make sense to apply individually:

- Merge changes from OpenJDK8u60 to j.u.Calendar,
j.u.GregorianCalendar, j.u.TimeZone, sun.util.calendar.BaseCalendar
and CalendarSystem. These depend on changes in java.time, so they
weren't done earlier and some java.time classes depend on them.
- Replace name lookups with ICU resource lookups where a direct
replacement exist.
- Stub out name lookups where the ICU equivalent is non-trivial (will be
added in later commit)

Bug: 28832222
Test: CtsLibcoreTestCases (2 failures due to Calendar.getDisplayName() being unimplemented)
Change-Id: I77ed768b01ab0701c807145466e0f1d5d217a6d5
alendar.java
regorianCalendar.java
imeZone.java
334cd2a7d6c160c34bdea2ffc94e621a15c61540 12-Jan-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Regex support for named capture groups." am: db9adc6bd9 am: 6887008047 am: f8a1273649
am: f07d45fb71

Change-Id: I165cd795f2b48e9787b1c71e5363f84696e4ad52
f07d45fb717c26db48f784d9e043f181dfc44cb4 12-Jan-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Regex support for named capture groups." am: db9adc6bd9 am: 6887008047
am: f8a1273649

Change-Id: Ic583a2541deee97d7c9187d9cde07dd63ecc5bc2
db9adc6bd98645dc6b9d1f15c5604b0f15a5b2b6 12-Jan-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Regex support for named capture groups."
8aab403d23d790754eaf67a78352cba9741e0ee6 12-Jan-2017 Tobias Thierer <tobiast@google.com> Document incorrect LinkedHashMap Spliterator ordering in Android N. am: 53c8c68409
am: 0ed4a4e262

Change-Id: Idb4e247ab08e42be5df1dbe56441c78213367c01
0ed4a4e262f1d612d4595def5b4bd9a5bebe98e3 12-Jan-2017 Tobias Thierer <tobiast@google.com> Document incorrect LinkedHashMap Spliterator ordering in Android N.
am: 53c8c68409

Change-Id: If4fcf4c4af7e88a2bd4d21ca927062919e2d05ac
69860bf2b28f0e14741a8895abdb77b45d1ed55d 11-Jan-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Regex support for named capture groups.

3 new methods in Matcher class: group(String), start(String),
end(String) that takes the name of named capture group.
Definition (?<name>X) and backreferencing (\k<name>) both
work fine. Added support for ${name} in replace methods.

Test: vogar OldMatcherTest
Bug: 19717812
Change-Id: Id6dce9158721917d644adb1a0b88d25ddb000fcd
egex/Matcher.java
53c8c684093c1778163ed386777e802e8f5188f1 10-Jan-2017 Tobias Thierer <tobiast@google.com> Document incorrect LinkedHashMap Spliterator ordering in Android N.

Note that in Android N, the Spliterators for LinkedHashMap's
Collection Views did not report the SUBSIZED characteristic;
the Spliterators.spliterator(collection, int) call in the
suggested code snippet implicitly adds that characteristic.

This means that a Spliterator obtained via the suggested code
snippet reports not only a different order but also different
characteristics from the LinkedHashMap's native iterators.
Few applications will care about this subtle difference, and
the new behavior seems to make more sense; therefore, the
documentation does not call out this aspect.

The latest version of LinkedHashMap in AOSP (since [1])
implements its Spliterators via Spliterators.spliterator(),
which means that they do report the SUBSIZED characteristic,
just like the ones obtained via the code snippet in the
documentation added by this CL. Regression tests for the
reported characteristics of these Spliterators will be
submitted to AOSP in a separate CL.

[1] http://r.android.com/255655 (2016-08-16)

Bug: 33945212
Test: make
Test: Verified that the bug exists via guava-testlib-21.0-rc2, code
inspection and via a small new (unsubmitted) test.
Test: Verified via a small new test (unsubmitted) that the code
snippets given in the documentation produce the correct
iteration order.
Test: Verified via a small new test (unsubmitted) that LHM's
Spliterators do not report SUBSIZED before this CL, but
that the Spliterators obtained via the suggested
workaround do. Tested that the characteristics reported
by the Spliterators obtained via the workaround code
match those from LHM in the latest version of AOSP.

Change-Id: Ia959b54765df64b27367ce45aedce3fb1eda477a
inkedHashMap.java
98b35b411ed68474fb2f40fde6e20d2ab5a9d0bc 06-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Revert "Revert "Workaround bogus TreeMap Comparators.""" am: b5ccb993c0 am: 8234306597 am: 1637b5bda9
am: 914e1d00d9

Change-Id: I4325f75f8a1e0259544057a805ab3ec94f46c7c6
b5ccb993c0111110c023ece3c5f989bb86fc9b36 06-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Revert "Revert "Workaround bogus TreeMap Comparators."""
48b8a257f78d6def94079b592000f9f5ff17fb3c 05-Jan-2017 Tobias Thierer <tobiast@google.com> Revert "Revert "Workaround bogus TreeMap Comparators.""

An app that is popular among testers is still broken.
This CL re-establishes the work-around to give the
app a little bit of time to update their dependencies
to the fixed versions.

This reverts commit 3733bc930b4f8a02b278dde1109d0cd42f7c4c08.

By reverting that revert, this CL re-applies the changes from
commit 78562a12977fc4d81cd31e7c5af05d66bb701ccd

*** THIS CHANGE IS TEMPORARY AND WILL LIKELY BE ***
*** REVERTED BEFORE THE NEXT ANDROID RELEASE ***

Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a
Test: these tests from guava-testlib 21.0-rc2's TestsForMapsInJavaUtil:
- testsForTreeMapNatural()
- testsForTreeMapWithComparator()

Bug: 34084348

Change-Id: I3d120f00bf5a14e89cf3d50c3931557191aa5f37
reeMap.java
6e243771ea7468ebe345f2f214021374ffd53c9a 05-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "App compat: Temporarily rename CopyOnWriteArrayList.array -> elements" am: 6e3c08b92c am: 73ed83d6fe am: e779adea73
am: 35d9aae30c

Change-Id: Ia385a9b251b26bdbcc54f324512ef6a2f2213543
3e090b8032714c0912697b678b8ab9d26bc1739b 04-Jan-2017 Tobias Thierer <tobiast@google.com> App compat: Temporarily rename CopyOnWriteArrayList.array -> elements

Up to version 1.5.2 [1], the streamsupport library used reflection
to access some private fields. Streamsupport 1.5.3 (2016-12-17)
fixed this by delegating to the platform's spliterators instead.

[1] https://github.com/streamsupport/streamsupport/tree/1.5.2

A popular app is still using streamsupport 1.5.2, which breaks
before this CL because it relies on the private field name
CopyOnWriteArrayList.elements that was replaced by the field "array"
in libcore commit 29957558cf0db700bfaae360a80c42dc3871d0e5. This CL
renames the field back to "elements" for now so that this app does
not break.

Streamsupport 1.5.1 already broke on Android N (bug 32029582), so
attempting to start supporting it now is infeasible / pointless.

This CL should be reverted once enough apps have stopped relying
on streamsupport 1.5.2.

Test: Manually checked that I was able to reproduce the crash in the
app from bug 33916927 on an internal build from today.
Test: Manually checked that the crash in the app from bug 33916927 no
longer occurs on an internal build after patching in this CL.
Test: Manually verified through code [1] inspection that the other
Collection subclass field names that streamsupport 1.5.2's
Spliterator implementations rely on match the ones currently
in AOSP. No empirical testing of any other apps nor of new
test code was performed.

Bug: 33916927
Change-Id: I29e6e72dec98b1934cd0198492bf1891838f04bd
oncurrent/CopyOnWriteArrayList.java
ee7517a72c5d8ebb8085d6526fe2b8dc9bd68274 04-Jan-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Update java.util.prefs to openJdk8u60" am: 8c0209d48d am: 47a302592d am: 4d44bbf8e8
am: 7fdfe83649

Change-Id: I48b1773ad12fc3e65a0af1e5483e8beeaf019ddf
8c0209d48d465b51e05b0869c49646000d6419fb 04-Jan-2017 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Update java.util.prefs to openJdk8u60"
1a7963aacd792e98949dfaee3e6afeaea3604c16 03-Jan-2017 Tobias Thierer <tobiast@google.com> Merge "Establish OpenJDK upstream for remaining java.util classes." am: c2cef2e89e am: 11293e43ec am: a1a9748d27
am: ddcfe7e95a

Change-Id: Idab593f52991acc5025a96446fe0bac2e8c70e59
bc1e8f94811dd4cb821fa35bce1fd007a6c71a61 29-Dec-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Update java.util.prefs to openJdk8u60

Contains header updates, use of generics and documentation
updates. No functionality changes.

Test: make -j 32 docs
Bug: 28666126
Change-Id: I1b69ed1738124a2590bdd7ff17c4afe462af8592
refs/AbstractPreferences.java
refs/PreferenceChangeListener.java
refs/Preferences.java
refs/PreferencesFactory.java
refs/XmlSupport.java
242e5bfd7e912be174c03a3c887369a6a9d6cbc2 20-Dec-2016 Tobias Thierer <tobiast@google.com> Establish OpenJDK upstream for remaining java.util classes.

The corresponding OpenJDK upstream commit is the same as
for java.util.concurrent [1]. Thus, this CL results in the
difference between the old and new upstream being applied to
ArrayPrefixHelpers.java.

Previous commit messages [2] suggesting that the other files
listed below were at the time directly derived from JSR-166
may have been incorrect.

All Android changes (removed link to collections framework docs;
fix framework docs link to "Collection#optional-restrictions")
are kept, as indicated by comments in the files.

This CL also fixes up some redundant missing/extra blank lines
that appeared to needlessly differ between Android and both
upstreams.

The set of classes in java.util that are contained in JSR-166
and mentioned by [2] but for which the OpenJDK upstream [1] is
now established are:

- ArrayDeque (removed a needless "E" that differed from both
upstreams)
- ArrayPrefixHelpers (newly moved to OpenJDK upstream [1])
- Deque
- Map (no changes required, not touched by this CL)
- NavigableMap
- NavigableSet
- PriorityQueue (no changes required, not touched by this CL)
- Queue
- SplittableRandom

Classes from java.util not on the above list are derived from
a different upstream revision such as OpenJDK8u60.

[1] between jdk-9+113 and jdk-9+114, as described in
http://r.android.com/304056 (libcore commit
29957558cf0db700bfaae360a80c42dc3871d0e5).
[2] commits fd81a99407d318ea3d8b5782294a0644e580d126
and e8b323c7cb7d55be9a4df579231e44f04f53d766
in libcore

Test: make
Bug: 30860904
Bug: 29935305
Change-Id: I46b19ce8afd6467d1134beeb6f3d7f5ebc09f8fa
rrayDeque.java
rrayPrefixHelpers.java
eque.java
avigableMap.java
avigableSet.java
ueue.java
plittableRandom.java
21d4e0dc2164d85196231f136b31076556ffd1f3 15-Dec-2016 Tobias Thierer <tobiast@google.com> Merge "Move java.util.concurrent from JSR-166 to an OpenJDK upstream" am: 98396f21e4 am: a5e008d288 am: acadcbd48f
am: a1b202e611

Change-Id: I5aa60e03193957ce839ba46eee4910b6730ed24b
29957558cf0db700bfaae360a80c42dc3871d0e5 19-Oct-2016 Tobias Thierer <tobiast@google.com> Move java.util.concurrent from JSR-166 to an OpenJDK upstream

Apply diff between JSR-166 and OpenJDK to java.util.concurrent.*

This affects
- all classes from java.util.concurrent
- all classes from java.util.concurrent.atomic
- all classes from java.util.concurrent.locks

This makes the license of these classes (GPLv2 with classpathi
exception) consistent with the other files taken from OpenJDK.

Previously, they were in the public domain (from JSR-166), with one
exception: CopyOnWriteArrayList.java (COWAL) was previously Android's
own implementation under Apache 2.0 license. This CL switches that
file to the same upstream OpenJDK revision as the other files touched
by this CL; it is therefore now under the same GPLv2+CE license.

For files other than COWAL, this CL applies the difference between
the old (JSR-166) and new (OpenJDK) upstream. That difference is:
- OpenJDK adds an additional license header (GPLv2+CE) to each file;
this CL adds those license headers.
- The JSR-166 backport of AbstractQueuedSynchronizer and ReentrantLock
commented out use of @ReservedStackAccess with a // OPENJDK-9
comment. In Android, this CL drops these lines entirely instead
- OpenJDK and JSR-166 use a slightly different paths in doc links to
Collection.html#optional-restrictions
For these, Android was already using a third variant so this CL
doesn't affect those.
- Flow and SubmissionPublisher are not available in OpenJDK 8 nor in
Android so they are missing from JSR-166's OpenJDK 8 backport and
are also omitted here.

Because the new upstream is based on OpenJDK, all of the files now
live in the ojluni/ source directory.

=== Upstream OpenJDK 9 revision that this code corresponds to

This corresponds to upstream revision 14076 with the changes from
revision 13050 reverted ("hg backout"). Revision 14076 is between
upstream mercurial tags jdk-9+113 (revision 13993) and jdk-9+114
(revision 14115). Backing out of revision 13050 was necessary in
order for the code to use sun.misc.Unsafe like it did before this
CL, rather than jdk.internal.misc.Unsafe which is not available
on Android.

This revision was obtained by running the following steps:

hg clone http://hg.openjdk.java.net/jdk9/jdk9 jdk9-tmp
cd jdk9-tmp
sh ./get_source.sh
cd jdk/src/java.base/share/classes/java/util/concurrent
hg update -r 14076
hg backout -r 13050 # arbitrarily resolved merge conflicts
rm Flow.java SubmissionPublisher.java # OpenJDK 9 specific
zip -r ~/juc.zip .

The merge conflicts in the backout step were resolved arbitrarily
since they involved files from outside of java.util.concurrent.*

=== Android changes (difference between Android and upstream OpenJDK)

The following changes are Android specific (they are not part of the
difference between JSR-166 and OpenJDK) so they were all kept /
(same as re-applying them on top of the new OpenJDK upstream). In
the case of links to Collection.html#optional in documentation, note
that JSR-166, OpenJDK and Android use three different paths, so
Android's version was kept. Generally these changes come with
Android-changed comments. When the changes are in documentation,
those comments are sometimes omitted since they don't fit in
documentation. To ensure that all of the below changes were
authored by AOSP authors, I have manually verified that each of
them either
(a) is a removal without comment, or
(b) there is an existing Android-changed, android-note or
similar comment that explains the change, or
(c) can be traced to the AOSP commit that introduced it

I'm specifying for each change below whether it falls into categories
(a), (b) or (c). For (c), I am listing the AOSP commit's SHA below.

The only new Android-changed block introduced by this CL is in
CopyOnWriteArrayList.

-ArrayBlockingQueue
(b): removed link to collections framework docs
- BlockingDeque:
(b) fixed framework docs link to "Collection#optional"
- BlockingQueue:
(b) removed link to collections framework docs
(b) fixed framework docs link to "Collection#optional"
- CompletableFuture:
(b) @hide several methods
(b) Removed sentences in toplevel documentation referring to
the methods defaultExecutor(), minimalCompletionStage() and
newIncompleteFuture() (explained by the @hide per above).
This includes removal of a paragraph around CompletionStage's
methods returning CompleteableFuture; that paragraph had been
referring to the @hide methods minimalCompletionStage() and
copy().
- ConcurrentHashMap:
(b) removed link to collections framework docs
(c) changes around keySet()'s return type from libcore commit
0ee1606ffb8586014fb3ea6e540c07d7180d9e9e
- changed compile time type of keySet() return value to be Set
rather than KeySetView, but add documentation guaranteeing
that the value will be a KeySetView.
- remove the reference to {@link #keySet()} from the links in
the documentation for KeySetView
(a) Remove use of annotation @jdk.internal.vm.annotation.Contended
(not available on Android).
- ConcurrentLinkedDeque:
(b) removed link to collections framework docs
- ConcurrentLinkedQueue:
(b) removed link to collections framework docs
- ConcurrentMap:
(b) removed link to collections framework docs
(b) fixed framework docs link to "Collection#optional"
- ConcurrentNavigableMap:
(b) removed link to collections framework docs
- ConcurrentSkipListMap:
(b) removed link to collections framework docs
- ConcurrentSkipListSet:
(b) removed link to collections framework docs
(b) fixed framework docs link to "Collection#optional"
- CopyOnWriteArraySet:
(b) removed link to collections framework docs
(b) fixed framework docs link to "Collection#optional"
- CountedCompleter:
(a) removed snippet
"(such as {@link java.nio.channels.CompletionHandler})"
from documentation (line ~ 45).
- DelayQueue:
(b) removed link to collections framework docs
- Exchanger:
(b) removed use of annotation
@jdk.internal.vm.annotation.Contended
(not available on Android)
- ExecutorService:
(b) removed security manager docs
- Executors:
(b) removed security manager docs & logic
- ForkJoinPool:
(b) removed use of annotation
@jdk.internal.vm.annotation.Contended
(not available on Android)
- ForkJoinTask:
(b) @hide pollSubmission() method (OpenJDK 9 API)
- LinkedBlockingDeque:
(b) removed link to collections framework docs
- LinkedBlockingQueue:
(b) removed link to collections framework docs
- LinkedTransferQueue:
(b) removed link to collections framework docs
- PriorityBlockingQueue:
(b) removed link to collections framework docs
- ScheduledThreadPoolExecutor:
(b) omit class-level docs on setRemoveOnCancelPolicy()
(b) Remove security manager docs from shutdown(), shutdownNow()
- SynchronousQueue:
(b) removed link to collections framework docs
- ThreadLocalRandom:
(a) One empty line dropped around line ~ 465
- ThreadPoolExecutor:
(b) removed security manager docs from shutdown(), shutdownNow()
(b) change setCorePoolSize() to not throw if
maximumPoolSize < corePoolSize
- TimeUnit:
(b) removed java 9 ChronoUnit related code
- TransferQueue:
(b) removed link to collections framework docs
- atomic/AtomicIntegerFieldUpdater,
atomic/AtomicLongFieldUpdater,
atomic/AtomicReferenceFieldUpdater:
(b) use of VMStack.getStackTrace1() in constructor
(b) commented out legacy security code
(b) commented out isAncestor()
- (b) atomic/Striped64: Commented out use of annotation
@jdk.internal.vm.annotation.Contended (not available on Android)

For CopyOnWriteArrayList, added the following two new Android changes:
- removed link to collections framework docs
- fixed framework docs link to "Collection#optional"

Bug: 30860904
Bug: 31028793

Test: CtsLibcoreJsr166TestCases (includes CopyOnWriteArrayListTest)
Test: CtsLibcoreJavaUtilCollectionsTestCases

Change-Id: I41e666d9825f6624e678b6c568326b1155b7adaf
oncurrent/AbstractExecutorService.java
oncurrent/ArrayBlockingQueue.java
oncurrent/BlockingDeque.java
oncurrent/BlockingQueue.java
oncurrent/BrokenBarrierException.java
oncurrent/Callable.java
oncurrent/CancellationException.java
oncurrent/CompletableFuture.java
oncurrent/CompletionException.java
oncurrent/CompletionService.java
oncurrent/CompletionStage.java
oncurrent/ConcurrentHashMap.java
oncurrent/ConcurrentLinkedDeque.java
oncurrent/ConcurrentLinkedQueue.java
oncurrent/ConcurrentMap.java
oncurrent/ConcurrentNavigableMap.java
oncurrent/ConcurrentSkipListMap.java
oncurrent/ConcurrentSkipListSet.java
oncurrent/CopyOnWriteArrayList.java
oncurrent/CopyOnWriteArraySet.java
oncurrent/CountDownLatch.java
oncurrent/CountedCompleter.java
oncurrent/CyclicBarrier.java
oncurrent/DelayQueue.java
oncurrent/Delayed.java
oncurrent/Exchanger.java
oncurrent/ExecutionException.java
oncurrent/Executor.java
oncurrent/ExecutorCompletionService.java
oncurrent/ExecutorService.java
oncurrent/Executors.java
oncurrent/ForkJoinPool.java
oncurrent/ForkJoinTask.java
oncurrent/ForkJoinWorkerThread.java
oncurrent/Future.java
oncurrent/FutureTask.java
oncurrent/Helpers.java
oncurrent/LinkedBlockingDeque.java
oncurrent/LinkedBlockingQueue.java
oncurrent/LinkedTransferQueue.java
oncurrent/Phaser.java
oncurrent/PriorityBlockingQueue.java
oncurrent/RecursiveAction.java
oncurrent/RecursiveTask.java
oncurrent/RejectedExecutionException.java
oncurrent/RejectedExecutionHandler.java
oncurrent/RunnableFuture.java
oncurrent/RunnableScheduledFuture.java
oncurrent/ScheduledExecutorService.java
oncurrent/ScheduledFuture.java
oncurrent/ScheduledThreadPoolExecutor.java
oncurrent/Semaphore.java
oncurrent/SynchronousQueue.java
oncurrent/ThreadFactory.java
oncurrent/ThreadLocalRandom.java
oncurrent/ThreadPoolExecutor.java
oncurrent/TimeUnit.java
oncurrent/TimeoutException.java
oncurrent/TransferQueue.java
oncurrent/atomic/AtomicBoolean.java
oncurrent/atomic/AtomicInteger.java
oncurrent/atomic/AtomicIntegerArray.java
oncurrent/atomic/AtomicIntegerFieldUpdater.java
oncurrent/atomic/AtomicLong.java
oncurrent/atomic/AtomicLongArray.java
oncurrent/atomic/AtomicLongFieldUpdater.java
oncurrent/atomic/AtomicMarkableReference.java
oncurrent/atomic/AtomicReference.java
oncurrent/atomic/AtomicReferenceArray.java
oncurrent/atomic/AtomicReferenceFieldUpdater.java
oncurrent/atomic/AtomicStampedReference.java
oncurrent/atomic/DoubleAccumulator.java
oncurrent/atomic/DoubleAdder.java
oncurrent/atomic/LongAccumulator.java
oncurrent/atomic/LongAdder.java
oncurrent/atomic/Striped64.java
oncurrent/atomic/package-info.java
oncurrent/locks/AbstractOwnableSynchronizer.java
oncurrent/locks/AbstractQueuedLongSynchronizer.java
oncurrent/locks/AbstractQueuedSynchronizer.java
oncurrent/locks/Condition.java
oncurrent/locks/Lock.java
oncurrent/locks/LockSupport.java
oncurrent/locks/ReadWriteLock.java
oncurrent/locks/ReentrantLock.java
oncurrent/locks/ReentrantReadWriteLock.java
oncurrent/locks/StampedLock.java
oncurrent/locks/package-info.java
oncurrent/package-info.java
80cf624eb28c02412fa8fd8519ffccb23af204f2 13-Dec-2016 Tobias Thierer <tobiast@google.com> Merge "Update Locale to OpenJDK8u60, part 2" am: c6c543e173 am: 05d70c76fa am: ded3285917
am: 9ac54ccb90

Change-Id: Ic61e86b01c04510acb2c1438fbb0aedaa165726e
c6c543e1738250d87ed2bdcfe8fe8e6e3f5c0245 13-Dec-2016 Tobias Thierer <tobiast@google.com> Merge "Update Locale to OpenJDK8u60, part 2"
148145bb19a2c154302b33264c951b60cc529f16 09-Dec-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Update java.util.jar to openJdk8u60" am: 08029be981 am: 734f7f97ee am: c1a1b50bf1
am: 9e83864694

Change-Id: Ie03f6e97a090175a369ed0bc62592f88955339fa
08029be9818782b2b3ef4327cd12102dca3fdbb7 09-Dec-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Update java.util.jar to openJdk8u60"
af33b46fdcb47760c0aa443182d70031609c5522 22-Sep-2016 Tobias Thierer <tobiast@google.com> Update Locale to OpenJDK8u60, part 2

This CL adds APIs for RFC 4647 Matching of Language Tags.
Assertions in added tests are a combination of current
behavior and examples from RFC 4647.

Notes:

* The upstream code has a bug where calling LocaleMatcher.parse()
modifies values of static final LocaleEquivalentMaps.multiEquivsMap.
This bug has already been reported upstream at
https://bugs.openjdk.java.net/browse/JDK-8166994
The upstream fix will be applied along with suitable tests in
a follow-up CL.
* Locale.filterTag() and Locale.lookupTag*() tends to return
lowerCase versions of the tags supplied, except when the
priority list of LanguageRanges contains a "*" or similar.
For now, LocaleTest lowerCases all tags (via tagsOf()) so that
the test can pass. I plan to submit a patch / proposal to
upstream to preserve case of the given tags, at which point
the test could be made more opinionated.
* The hard coded mapping of equivalent locales in
LocaleEquivalentMaps comes from an unknown source. It doesn't
appear to be present in ICU so this CL is taking the upstream
mapping for now.
* Notwithstanding the comments above, the code added to
Locale.java, LocaleEquivalentMaps.java and LocaleMatcher.java
in this CL exactly matches upstream OpenJDK8u60. No attempt
has been made to make this code cleaner / more robust in this
CL.

Bug: 29935305
Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a

Change-Id: Ie86477b8eea1f5f3d69d4f161628847793d372fd
ocale.java
03d2687dfc9b84bb16ea2b5f6a85da539696b30c 29-Nov-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Update java.util.jar to openJdk8u60

Attributes.java
- header change
- Use of generics
- Updated documentation links
- Deprecated:
EXTENSION_INSTALLATION, IMPLEMENTATION_VENDOR_ID, IMPLEMENTATION_URL

JarEntry.java
- header change
- Updated javadoc

JarFile.java:
- Entry enumerator moved to seperate static inner class
- Streams implementation
- Non-crucial META-INF/* (not *.SF|*.DSA|*.RSA|*.EC|MANIFEST.MF) files are not
passed to JarVerifier in .intializeVerifier() call. Otherwise we could signal
the end of META-INF parsing (due to changes in JarVerifier).
- Refactoring of hasClassPathAttribute, divided into
many methods
- Android-changed: Commented out isKnownNotToHaveSpecialAttributes()
method that doesn't make sense on android

JarOutputStream.java
- Header change
- Replaced a use of "& 0xff" with a cleaner conversion to unsigned int

JarVerifier.java
- Use of generics
- beginEntry explicitly omits META-INF manifest and index signature
check (So they can be passed to beginEntry without side-effects)
- beginEntry process properly non-crucial META-INF/ entries (not
*.SF|*.DSA|*.RSA|*.EC|MANIFEST.MF) and checks their signatures
(added a test for that)
- Change from "Enhance signed jar verification": .entryNames
treats .findMatchingSigners(c) null result as empty array
(probably a bug fix).

Manifest.java
- Use of generics
- Replaced a use of "& 0xff" with a cleaner conversion to unsigned int

Pack200.java
- Copyright update
- javadoc formating changes
- addPropertyChangeListener & removePropertyChangeListener gained empty default
implementation and deprecated

SignatureFileVerifier.java:
- uncommented isSigningRelated (requried by JarFile)

Test: CtsLibcoreTestCases
Change-Id: I56c59fac628c97a8b7c6967a43c0e23c8b068120
ar/Attributes.java
ar/JarEntry.java
ar/JarFile.java
ar/JarOutputStream.java
ar/JarVerifier.java
ar/Manifest.java
ar/Pack200.java
558e9c5474f5ba77f973053c7faf69d1f83e9d09 06-Dec-2016 Neil Fuller <nfuller@google.com> Fix Formatter.format("%,d") for locales without grouping

Fix Formatter.format("%,d") for locales without grouping
in their defaul decimal format.

Bug: 33245708
Test: vogar luni/src/test/java/libcore/java/util/FormatterTest.java
(cherry picked from commit 26d1f75ec1f3749e3def869fecb11a7dc0d3a31d)

Change-Id: I4164ae51d5abf12dd5031d714bfdcde1b21911a1
ormatter.java
c4b653490e30cc19c94da929cddfd35593f688aa 06-Dec-2016 Neil Fuller <nfuller@google.com> Merge "Fix Formatter.format("%,d") for locales without grouping" am: 7b0b51c30d am: 7a7e340a43 am: afbf3ddd0b
am: 48c41c7e63

Change-Id: I2bfc00da8ef0976235d3d277c3a287e5aac63ee8
7a7e340a43f6ee2ba93cca78ebcec74f585b2c7a 06-Dec-2016 Neil Fuller <nfuller@google.com> Merge "Fix Formatter.format("%,d") for locales without grouping"
am: 7b0b51c30d

Change-Id: I35bd1104b5732cd8cfb105d89ba65cea33bb3d62
26d1f75ec1f3749e3def869fecb11a7dc0d3a31d 06-Dec-2016 Neil Fuller <nfuller@google.com> Fix Formatter.format("%,d") for locales without grouping

Fix Formatter.format("%,d") for locales without grouping
in their defaul decimal format.

Bug: 33245708
Test: vogar luni/src/test/java/libcore/java/util/FormatterTest.java
Change-Id: I2e0cf7757702d80993073979a7f3e854cc0489e8
ormatter.java
44d40c2a5aa1f60f1d137a6734f7fa21e445c5a0 28-Oct-2016 Tobias Thierer <tobiast@google.com> API: Rename Collections.singleton*() type arg E -> T

This rename is part of the update of Collections.java to OpenJDK8u60.

This is compatible change because generic type argument names affect
neither compile time nor runtime compatibility.

The build system (incorrectly) flags this as a change to a released
API. Removing or changing released public APIs is infeasible on AOSP.
Therefore this change will remain restricted to internal branches
until the API is released.

Bug: 31902309
Bug: 29935305
Test: make

Change-Id: I07f1ac7aa9afae4a549ea3eb668288b5e8595aad
ollections.java
87f7605e13ad5eea96f294a1fcc79f4208681825 17-Nov-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "java.util.zip.Zip* port from openJdk8u60"
am: 33f6c9f4ed

Change-Id: Ic0861e6a1a11da2d5439032d8d3706934309bd20
6c970474e9416807cabde3620045906ad3903c6c 01-Nov-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> java.util.zip.Zip* port from openJdk8u60

- Added missing android-changed tags for various changes.
- Fixed buggy extended DOS timestamp generation/reading
in ZipEntry and ZipUtils.

ZipEntry:
-Support for extended dos time (better timestamp resolution).
-Support for last modification, access time and creation time
stored in optional extra data.
-Because of last modification field, setTime works for ranges
outside of dos time range (< 1980 && > 2099). THIS change breaks
ZipEntryTest.test_setTimeJ. IMHO it's worth to adopt new
behavior.

ZipFile:
-Added spliterator support.
-Moved entries() iterator implementation to inner named class.
-ZipFileInputStream#read modifies pos/rem field in a
synchronized block.

ZipInputStream:
-Removed code for parsing optional extra data in .readLOC
(moved to ZipEntry).

ZipOutputStream:
-New property for inhibiting Zip64 for > 64k entries
-ZipEntry last modification, access time and creation time
support

ZipUtils.java:
-New file with common, time and byte-array related methods extracted
from ZipEntry and ZipFile

java_util_zip_ZipFile.c
-Use of ZIP_GetEntry2 with explicit addSlash param

zip_util.c/h:
-hash(const char *s) no longer used.
-New method, ZIP_GetEntry2, with explicit handling
of adding slash at the name end
-Zip entry name may include embedded null character.

Test: CtsLibcoreTestCases
Bug: 29935305
Change-Id: Ib691c81b158ec37419a903bfa4261a12139fbff7
ip/ZipEntry.java
ip/ZipFile.java
ip/ZipInputStream.java
ip/ZipOutputStream.java
ip/ZipUtils.java
d622dc963ccb6caeec557aeb93dd518735393c58 10-Nov-2016 Tobias Thierer <tobiast@google.com> Merge "Implement Collections.sort() on top of List.sort(), not vice-versa"
am: b65f8d4962

Change-Id: Id2509a7fdbd34f7554e438630776bcf61c7dd7cc
b65f8d4962a69ba4bf253a3cbf9cee75085c64d6 10-Nov-2016 Tobias Thierer <tobiast@google.com> Merge "Implement Collections.sort() on top of List.sort(), not vice-versa"
ec2262e64709932f58f88dd448fab25f4be7f663 09-Nov-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix ZipFile exception for non-existent files

This change fixes N regression in java.util.zip.ZipFile constructor.
In previous android releases, for non-existent files, ZipFile
constructor was throwing FileNotFoundException. Due to
change in commit adc40417389a57bc7a831f55334bffcc07343eb9,
N started to use ZipException in this case. This change
reverts to pre-N behavior.

Test: libcore.java.util.zip.ZipFileTest
Bug: 31077136
Change-Id: I7c7240d0808552f4e0cf4ed4ccbda7537df2d2b1
(cherry picked from commit d95a908045486d862dfe0be056dd4ecfb3bd7693)
ip/ZipFile.java
ce27766ff2cb33432017df70f74f0732adaabd97 09-Nov-2016 Narayan Kamath <narayan@google.com> ZipFile: Never change file offset during I/O operations.

Use pread instead read and eliminate unnecessary calls to lseek.

dalvik.system.VMClassLoader maintains a cache of JarFile objects
that it creates whenever it loads resources from them. This cache may
be populated in the zygote as a side effect of preloading classes. When
processes are forked from the zygote, the file descriptors associated
with these JarFile objects point to the same kernel file description
and may end up stepping on each others toes. To avoid such issues, we
never make any offset changes to the associated file.

Note that we have a guarantee that the file will never be closed in
any forked process because the associated JarFile objects can never be
collected.

Test: run cts -m CtsLibcoreTestCases / ZipStressTest / manual testing
to trigger the race condition.

Bug: 30407219
Change-Id: Ic770a6ab6aca7f123a90002327d7f0a321e9afef
(cherry picked from commit 0393d3c84ed9bd24bcf0dac3782a1cc23400ace8)
ip/ZipFile.java
48dd2b2377f6d676f1af6f37b290474a00cab94f 01-Nov-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Port java.util.zip.GZIPInputStream changes from OpenJdk8u60"
am: 1cbb00d875

Change-Id: I4636dccb773bc443c55a48718a193a82c44aaa40
1cbb00d875642779dd1f80cfc65864b28d90badc 01-Nov-2016 Treehugger Robot <treehugger-gerrit@google.com> Merge "Port java.util.zip.GZIPInputStream changes from OpenJdk8u60"
cc2ba8a2b5b33eaebbe03adceea68abe8576e354 27-Oct-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port java.util.zip.GZIPInputStream changes from OpenJdk8u60

Contains:
- Header update
- Added missing android-changed tag
- Fix for GZIPInputStream calling "close" on the input
stream in it's read() (specifically in the readTrailer).
Problem originates from SequenceInputStream usage
side-effect.

Test: cts run of CtsLibcoreTestCases
Bug: 29935305
Change-Id: I7986fe5d506f39cf4e45d37706623f8e195b4bcf
ip/GZIPInputStream.java
5ae9d084f85cce06b02f7cee28db87ebe6be5056 27-Oct-2016 Tobias Thierer <tobiast@google.com> Implement Collections.sort() on top of List.sort(), not vice-versa

This is an app-observable behavior change relative to Android N.

This updates List.sort() and Collections.sort() to OpenJDK8u60.
Previously, Android had been using the logic from earlier version
of OpenJDK8 (present up to u19 or so). See:
https://bugs.openjdk.java.net/browse/JDK-8030848

The new behavior makes Collections.sort() more efficient for
List implementations that override List.sort() with a specialized,
efficient implementation. It also makes the modCount behavior of
Collections.sort() consistent with that of overridden List.sort()
implementations.

This behavior change carries a risk of app compat issues in future
versions of Android. Specifically:

- List.sort() implementations that delegate to Collections.sort()
will now infinitely recurse. Such implementations should be
fixed to call super.sort() instead.

- List implementations that override sort() with a version that
changes the value of modCount (this affects e.g. ArrayList but
not LinkedList), will now throw ConcurrentModificationException
if Collections.sort(list) is called in the middle of an iteration.

In such cases, the calling code should be fixed. E.g.,
- don't sort the list in the middle of iterating, or
- loop over list indices instead and use List.get(int), or
- convert the List to an array or a LinkedList first

Should serious app compat issues arise, possible ways to address
them in the platform include:

- revert this change, or
- make the change dependent on targetSdkVersion, or
- detect (indirect) recursive calls to Collections.sort()
and deal with them by logging, throwing a more informative
exception, or changing behavior.

Tests were updated to assert the new behavior.

The harmony CollectionsTest uses an ArrayList subclass that
throws UnsupportedOperationException from ArrayList.set()
without also overriding ArrayList.sort(). This makes the
subclass used in the test inconsistent with the List.sort()
documentation that claims that List.sort() will throw such
an exception if List.listIterator().set() does; this
inconsistency now also affects Collections.sort(). Therefore
the test was updated in this particular place to use a
different List implementation instead that, unlike ArrayList,
does not override List.sort().

Bug: 31902309
Bug: 29935305
Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a

Change-Id: I6aad092f77ecee3eac3e633e1d59957e768fbf2b
ollections.java
ist.java
9ed25c84361a626b66692a6924bfac5ab8ce3e59 28-Oct-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Port java.util.zip.(CRC|Adler)32 changes from openJdk8u60"
am: b3982e508c

Change-Id: Iff7f18186dbf71ff4d53bcb0cd97e3475d753b10
6c877179523385568cb4752a5825bf76f46769e2 26-Oct-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port java.util.zip.(CRC|Adler)32 changes from openJdk8u60

- Added new method for both CRC32 and Adler32:
update(ByteBuffer).
- Minor javadoc and header updates

Test: cts run of CtsLibcoreTestCases
Bug: 29935305
Change-Id: I80acc491d36f5b6a04e6a2dbeb461632d02389f6
ip/Adler32.java
ip/CRC32.java
da196975402c72c2e9e43d977d4ad4d28e210962 26-Oct-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Port trivial java.util.zip changes from openJdk8u60"
am: b2d6966995

Change-Id: I24940f5e467bd6179ab212223d31e4cc05d8c273
f54e9b2a5f66f0caa1ae89e15ed0a26d00795df1 25-Oct-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port trivial java.util.zip changes from openJdk8u60

This change consists of javadoc updates, minor code
changes and missing android-changed tags. Non-trivial
changes will be handled in separate changes.

Deflater: Missing close-guard&initIDs android-changed tag
DeflaterInputStream: Javadoc updates
DeflaterOutputStream: Javadoc updates, added missing android-changed tag
in .deflate()
GZIPOutputStream: Javadoc updates
Inflater: Javadoc updates, missing close-guard&initIDs android-changed tag
InflaterInputStream: Added missing Android-changed tags, javadoc updates,
replaced "& 0xff" with Byte.toUnsignedInt call.
InflaterOutputStream: Javadoc updates
ZipConstants, ZipCoder: Header update
package.html: ZIP app note URL refresh
java_util_zip_Deflater.c: init method switch reformated, Z_VERSION_ERROR
handling
java_util_zip_Inflater.c: init method switch reformated, Z_VERSION_ERROR
handling

Test: cts run of CtsLibcoreTestCases
Bug: 29935305
Change-Id: If9223c5835a273cf20d77fb1432b989f644ac41d
ip/Deflater.java
ip/DeflaterInputStream.java
ip/DeflaterOutputStream.java
ip/GZIPOutputStream.java
ip/Inflater.java
ip/InflaterInputStream.java
ip/InflaterOutputStream.java
ip/ZipCoder.java
ip/ZipConstants.java
ip/ZipConstants64.java
ip/package.html
5142175cda11e0d682c12e5f77a506f92d54cb70 13-Oct-2016 Tobias Thierer <tobiast@google.com> Merge "Change Locale.getDisplayScript() behavior to default to DISPLAY Locale." am: 515ed32a00 am: 9fbbd08135
am: 8136b8cb84

Change-Id: I4ce436f0b384de13082baf9e5c8c319990963f08
8136b8cb84451cf6cd5af6204f4b389ecc67d092 13-Oct-2016 Tobias Thierer <tobiast@google.com> Merge "Change Locale.getDisplayScript() behavior to default to DISPLAY Locale." am: 515ed32a00
am: 9fbbd08135

Change-Id: I3103f88d515df95fda992523934b853d40d3436d
9366e22dac87685c5be3f63b5b265e68cd9b6c9a 30-Sep-2016 Tobias Thierer <tobiast@google.com> Change Locale.getDisplayScript() behavior to default to DISPLAY Locale.

This makes getDisplayScript() more consistent with other methods such
as getDisplayName() and getSymbol() that were already using the default
DISPLAY Locale as opposed to the default Locale.

This updates these methods and their documentation to OpenJDK8u60.

LocaleTest reuses the Locales helper class which was pulled to the
top level from CurrencyTest.Locales and slightly refactored.

Test: libcore.java.util.CurrencyTest
Test: libcore.java.util.LocaleTest

Bug: 29935305

Change-Id: I784269d9695d15873568bad99839d8aadbad4f6c
ocale.java
126b76f0b957aa0f390b6630574e1c84c5618e14 06-Oct-2016 Neil Fuller <nfuller@google.com> Merge "Removal of text/util spi classes and references" am: 143b9e98f8 am: a24d981c97
am: 87a3a072d0

Change-Id: I76134d8a638fb7f85287308af72f53bd1f9de2d1
87a3a072d03f7597561e8bb7f2201a4c0e4cb5db 06-Oct-2016 Neil Fuller <nfuller@google.com> Merge "Removal of text/util spi classes and references" am: 143b9e98f8
am: a24d981c97

Change-Id: I7b1a69b86b6409ea79a2f9683e600a93b9521bf3
143b9e98f8e4bf304122ffbd89e0fa62d4e98eff 06-Oct-2016 Neil Fuller <nfuller@google.com> Merge "Removal of text/util spi classes and references"
92924f23a03635bb194b6481c4a950e6414ca4e4 04-Oct-2016 Neil Fuller <nfuller@google.com> Removal of text/util spi classes and references

This commit contains changes to docs and code.

Reasoning:

The changes made in Android to delegate through to ICU for
various I18N concerns make it unlikely that Android could
support the SPI code without substantial testing.

Explicitly removing the code and docs removes the
pretence / confusion over Android support for pluggable
locale data. It has definite code-size impact and will have
a slight runtime performance improvement.

Changes:

The docs previously referenced SPI classes that are not
public on Android. These references and associated
conditional text have been removed. Some references to
methods returning at least Locale.US have also been
removed because Android provides a larger set.

Code related to calls to the LocaleServiceProviderPool
has been removed or commented. The SPI classes and internal
support classes have been deleted.

Some additional "Android-changed" markers have been made
to highlight Android changes associated with the use of ICU
and/or preexisting removal of the SPI.

Bug: 31851669
Test: Ran CtsLibcoreTestCase and make checkbuild
Change-Id: I262b33f2c88d88dbb0c2f1d2b116952dc4e046e3
ocale.java
esourceBundle.java
pi/CurrencyNameProvider.java
pi/LocaleNameProvider.java
pi/LocaleServiceProvider.java
pi/ResourceBundleControlProvider.java
pi/TimeZoneNameProvider.java
pi/package.html
71f416470675a093bb7229fda8befa7c9683ab73 03-Oct-2016 Tobias Thierer <tobiast@google.com> java.util.Arrays: drop dead code for LegacyMergeSort am: c6493c449b am: 531b1f0ced
am: d722bf903c

Change-Id: I6d9d3c59c7a4f2d1654fb640c48f12866efa81ba
7e5cd75681470ff995a24c90a83946e3e09401a2 03-Oct-2016 Tobias Thierer <tobiast@google.com> Update Collections to OpenJDK8u60 (part 1) am: 4bdfc5a9fe am: 2482471cef
am: c47ac63c09

Change-Id: Ia69706bc3f68e37a022cce21b7bff0902cdb3612
562337b1c6446b23c16454420724d2af2d616c8c 03-Oct-2016 Tobias Thierer <tobiast@google.com> Update Arrays to OpenJDK8u60 am: 839c3929d1 am: 4630869582
am: 449dad903a

Change-Id: I28852d8fa64658bb533d992c54bee2c668fd75fb
d722bf903c8f9a837f591a09aae68b2480ea6bf4 03-Oct-2016 Tobias Thierer <tobiast@google.com> java.util.Arrays: drop dead code for LegacyMergeSort am: c6493c449b
am: 531b1f0ced

Change-Id: I01652301a954cbff2b8518b4913427d63438374d
c47ac63c09a42affefddd2fd31172b390298463a 03-Oct-2016 Tobias Thierer <tobiast@google.com> Update Collections to OpenJDK8u60 (part 1) am: 4bdfc5a9fe
am: 2482471cef

Change-Id: Iaf25a76092508d983241fe38768b6bf4792b6fc6
449dad903aaef147f6b66c46ff1a2d3642659e46 03-Oct-2016 Tobias Thierer <tobiast@google.com> Update Arrays to OpenJDK8u60 am: 839c3929d1
am: 4630869582

Change-Id: I49b6db2b44bdfc54656dc819503e2be0ec93cae8
531b1f0ced46161537bba5f813f021ca45cd757e 03-Oct-2016 Tobias Thierer <tobiast@google.com> java.util.Arrays: drop dead code for LegacyMergeSort
am: c6493c449b

Change-Id: Ib33e5a9480a0f3330264290d86776a15bcb6181f
2482471cefbdf24d6f776c605ae2e3b68135568e 03-Oct-2016 Tobias Thierer <tobiast@google.com> Update Collections to OpenJDK8u60 (part 1)
am: 4bdfc5a9fe

Change-Id: Ia15831837553b70ca0d6ba82407b30e52f31417e
463086958284a3f96595fdf79f68f244cf17d396 03-Oct-2016 Tobias Thierer <tobiast@google.com> Update Arrays to OpenJDK8u60
am: 839c3929d1

Change-Id: I520845d76347cdd3176215bce2cab3181ee0e3c1
24373421f3825738523ca0d50e9648d0c1cd7095 03-Oct-2016 Tobias Thierer <tobiast@google.com> Merge changes from topic 'bug29935305_collectionwrappers'

* changes:
java.util.Arrays: drop dead code for LegacyMergeSort
Update Collections to OpenJDK8u60 (part 1)
Update Arrays to OpenJDK8u60
c6493c449b5e3e9d295d0504b3148370f1ec8de0 03-Oct-2016 Tobias Thierer <tobiast@google.com> java.util.Arrays: drop dead code for LegacyMergeSort

Test: make
Change-Id: I33657fb90039f7bd4b771532078903020812c235
rrays.java
4bdfc5a9fee71c4a62c9ecd33e6cfd3421b29a3d 31-Aug-2016 Tobias Thierer <tobiast@google.com> Update Collections to OpenJDK8u60 (part 1)

Documented why updating Collections.sort() would carry app
compat risk. We may still decide to update that method to
OpenJDK8u60 but if so then it should be done in a separate,
targeted CL that can be separately reverted (if necessary).

The Android-changed section in CheckedList.replaceAll()
was dropped.

The following new static factory methods were added to
Collections.java but were marked @hide because they do
not yet have tests:
unmodifiableNavigableSet()
unmodifiableNavigableMap()
synchronizedNavigableSet()
synchronizedNavigableMap()
checkedQueue()
checkedNavigableSet()
checkedNavigableMap()
emptySortedSet()
emptyNavigableSet()
emptySortedMap()
emptyNavigableMap()

Remaining work for future CLs:
- decide whether to update Collections.sort() to
OpenJDK8u60 (implement Collections.sort() on top of
List.sort() rather than the other way round).
- Add test coverage for the new static factory methods
mentioned above, and un-@hide them.
- rename the Collections.singleton{,List}() type
parameter from <E> to <T>.

Bug: 29935305
Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a

Change-Id: I28fda8b23261a225291d3ae5b9b0170a55cc64d4
ollections.java
a35ecc82c540859f99acd909298ab0a6f064d384 03-Oct-2016 Tobias Thierer <tobiast@google.com> Merge "Update Locale to OpenJDK8u60 (part 1/2)" am: 57c2d5a042 am: 2ee040ae2d
am: c99b00671c

Change-Id: Ib378f3e3a5c1dea12a961d81d716d25dab96d8fa
c99b00671cd236d45d8f25c4e97333145a48cb45 03-Oct-2016 Tobias Thierer <tobiast@google.com> Merge "Update Locale to OpenJDK8u60 (part 1/2)" am: 57c2d5a042
am: 2ee040ae2d

Change-Id: I9f35ef23cd491ccd0a7d7d2e4ade5f3771ab7532
576d068c35ff06115b74d26ce726ea141ba8f5f1 21-Sep-2016 Tobias Thierer <tobiast@google.com> Update Locale to OpenJDK8u60 (part 1/2)

The additions for the new API for RFC 4647 Matching of Language Tags
is left to a potential future part 2/2.

This CL updates all other parts of Locale. Specifically:
* added new hasExtensions() (also used internally by the class),
stripExtensions() plus corresponding tests
* minor tweaks (formatting, @return sections, default DISPLAY locale
clarification, ...) to documentation.
* initialize defaultLocale eagerly during <clinit> rather than lazily
* add Android-changed comments to several existing sections that
were missing them
* introduce field languageTag to cache result of toLanguageTag()
* Note: There are four methods whose implementation on Android is
based on ICU. Upstream's implementations internally use a helper
method getDisplayString() that uses LocalServiceProviderPool;
that method has changed upstream to no longer pass a pool, which
means that the pool will not be used as a fallback for localizing
strings. I think the Android implementation doesn't need to change
but please double check.

Bug: 29935305
Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a

Change-Id: If595cf8b69021f78b76a9a223a0f0d906e74cdc8
ocale.java
839c3929d114963f4da459267bdd29b4837c290e 24-Aug-2016 Tobias Thierer <tobiast@google.com> Update Arrays to OpenJDK8u60

No new public APIs were added.

Changes:
- Added missing Android-changed comments
- Moved rangeCheck method to a different position in the file
- Moved Android-changed method checkOffsetAndCount
from AOSP commit 983b2c6ff9ea6d35adf7ab6398dccf870b7e180a
to a more natural position in the file
- Added override for sort() in Arrays.asList() implementation
- Other minor changes

Bug: 29935305
Test: Nothing, test will be run at next CL (submitted together)

Change-Id: Id26bc67b5fd9d8c0151cd88fa97641c04b95f9bf
rrays.java
a84ce2ea84d9c9e63c7c27cf02e44b107c55d102 30-Sep-2016 Tobias Thierer <tobiast@google.com> Change Currency.get{DisplayName,Symbol}() to use DISPLAY Locale am: 4a8e57872d am: b78fa76154
am: 11ca598a66

Change-Id: I1197c06b4c0672ef3038f713ee52a4894553a28c
dbb33b8cf87dbbc541ca8f3639a1835e0991b9c0 30-Sep-2016 Tobias Thierer <tobiast@google.com> Revert Locale behavior of Currency.get{Symbol,DisplayName} am: 7d8588a5a5 am: a723220674
am: 4e17820f33

Change-Id: If3fdf236422eb4fc54e0a640bc2e757fb6bcaa5a
11ca598a66269a075affdab287846acad0027d8c 30-Sep-2016 Tobias Thierer <tobiast@google.com> Change Currency.get{DisplayName,Symbol}() to use DISPLAY Locale am: 4a8e57872d
am: b78fa76154

Change-Id: I2ffddb841fb6c2dcc10b548d8d729c3df05a919d
4e17820f3330f55d23e36e911084a4ca0dd1e5fc 30-Sep-2016 Tobias Thierer <tobiast@google.com> Revert Locale behavior of Currency.get{Symbol,DisplayName} am: 7d8588a5a5
am: a723220674

Change-Id: I38b84039b33e621467f54cd1acaa6dee619e12cb
4a8e57872d83984f7f334132729b1c9a04afa86f 28-Sep-2016 Tobias Thierer <tobiast@google.com> Change Currency.get{DisplayName,Symbol}() to use DISPLAY Locale

This is a behavior change relative to Android N, which introduced
these methods.

In Android N, they used the default Locale which apps can set have
a different value than the default DISPLAY Locale.

Bug: 31794800

Test: libcore.java.util.CurrencyTest
Test: org.apache.harmony.tests.java.util.CurrencyTest

Change-Id: I778e303e16014f562eacdf347059aa0b34e08829
urrency.java
7d8588a5a508deb69849b8ed4f7af80a19adcb2b 28-Sep-2016 Tobias Thierer <tobiast@google.com> Revert Locale behavior of Currency.get{Symbol,DisplayName}

AOSP commit 6d48c53a48541c15e00cd9af660d849d55c418cf changed
those methods to use the DISPLAY Locale rather than the
default Locale. We do want the new behavior, but it should
be in a targeted CL with corresponding tests.

Therefore, this CL temporarily reverts these two lines
to the old behavior, followed by another small CL that
reintroduces the new behavior and adds tests.

Bug: 29935305
Bug: 31794800

Test: libcore.java.util.CurrencyTest
Test: org.apache.harmony.tests.java.util.CurrencyTest
Change-Id: Ic84f3e191baa441b8e6d367ce04d8fe7b5ddd6d0
urrency.java
0589c5a971e3354d3b0fb2d4a5ad25497718c54e 28-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Let Currency.getDisplayName(null) throw NPE." am: a4dc778ff7 am: f50f62ceb7
am: b5e06436b3

Change-Id: I84e28e864d066c2469c80680b82e1931aeb50593
eb938b8e56c3ec662b5206b626c56a7f0896891d 28-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Currency to OpenJDK8u60" am: 30e9c61f7c am: 76e5a1b9e3
am: 0c490f049c

Change-Id: I91b8160ceafa84dde0df59856e6f8cb5e21d5593
b5e06436b3f03967fc4653d22be443f18ef5ffcf 28-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Let Currency.getDisplayName(null) throw NPE." am: a4dc778ff7
am: f50f62ceb7

Change-Id: If3abf801300b91aef472b78a71c0b7afb24f8d89
0c490f049c014391793336df2f19d77cb97f3665 28-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Currency to OpenJDK8u60" am: 30e9c61f7c
am: 76e5a1b9e3

Change-Id: Ieeb66c46c494d1d868e92c701469d881ef82da9f
744e29af4f98397771d4737121dba11505565e8c 27-Sep-2016 Tobias Thierer <tobiast@google.com> Let Currency.getDisplayName(null) throw NPE.

Previously (at least on Android N), it returned the display name
in some locale (probably the default locale but I haven't checked).
This was inconsistent with the documentation.

This CL changes the behavior to throw NPE instead, which is
consistent with the documentation and with the RI.

Added test for expectation of NPE when passing null to several
Currency methods.

Bug: 31765082

Test: Ran both CurrencyTest classes.

Change-Id: I4b64358d28e25ff96d666700ae3ffddc0a7f8d6d
urrency.java
6d48c53a48541c15e00cd9af660d849d55c418cf 26-Sep-2016 Tobias Thierer <tobiast@google.com> Update Currency to OpenJDK8u60

- Document existing Android-changed sections that are implemented
on top of ICU (field icuCurrency).
- Remove documentation that incorrectly stated that Currency data
can be superseded via a properties file; this is not supported
on Android.
- In getSymbol() and getDisplayName(), explicitly use
Locale.getDefault(DISPLAY) rather than rely on ICU Currency's
no-argument methods doing the same.
- Apply upstream change to turn Map of instances into a
ConcurrentHashMap.
- Other minor tweaks to minimize diff against upstream.

Bug: 29935305

Test: cts-tradefed run cts -m CtsLibcoreTestCases -a arm64-v8a

Change-Id: I39e0f84c83475f825309b2fecef7b4abad7bd0ff
urrency.java
db6ca44a96696f3c384a8b88ee9f60c78a363008 27-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update ResourceBundle related classes from java.util to OpenJDK8u60" am: df35815c5f am: ec21fea48a
am: 4328ab965d

Change-Id: I66073edbf815c13ebe9b363e156293f15713543b
4328ab965df5920a54715bc2dac1494143563cc8 27-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update ResourceBundle related classes from java.util to OpenJDK8u60" am: df35815c5f
am: ec21fea48a

Change-Id: I9500f74d0c82b8d9bd989a71fd68e3f00612d258
df35815c5fe2ec682ac45d62d24de8d3fc13af37 27-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update ResourceBundle related classes from java.util to OpenJDK8u60"
f698ce77be4897daeff0b6a458887eea84ca9144 26-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Properties to OpenJDK8u60" am: 44d6334912 am: e206392d90
am: aab49437f9

Change-Id: Iec9810db618883e9e9ae6c8fb0b41f4dbaaad0a9
aab49437f965fdd48fb03275652febf0a5385ad3 26-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Properties to OpenJDK8u60" am: 44d6334912
am: e206392d90

Change-Id: I2faeb22362eac20cffe4fe5cc078903c1e3902bf
44d63349125ee3963915246fef79a02b0561bc8e 26-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Properties to OpenJDK8u60"
4bf3fba8f90e901b50af7ed4e16f02d0bcdf5bcf 06-Sep-2016 Tobias Thierer <tobiast@google.com> Update Properties to OpenJDK8u60

- This contains a deliberate behavior change in the case of
a single backslash (possibly followed by newline characters)
at the end of input. Such a trailing backslash is now skipped
whereas previously it was parsed as \u0000.

The new behavior makes more sense and there is nothing in
the documentation asserting either behavior. Further, the
new behavior matches upstream.

The tests that were asserting the old behavior were
added as harmony SVN revision 617124 with commit message
"Fix for HARMONY-5414 (java.util.Properties.load() decodes
invalid unicode sequences)". This references the harmony bug:

https://issues.apache.org/jira/browse/HARMONY-5414

While the test code attached to the bug does cover the
case of a lone \, it is not mentioned in the bug description.
The bug otherwise focuses on unicode sequences with numbers
of digits other than 4, e.g. \u123 which is asserted to yield
IllegalArgumentException.

This CL changes the test to assert the new behavior which is
that the backslash is ignored/trimmed.

This CL also adds more comprehensive test coverage for
properties read from a Reader and with trailing backslashes
at end of line followed by end of input, newline characters,
or additional lines.

- Android-changed: The implementation for loading/storing
properties from/to XML stil uses OpenJDK7u40's java.util.XMLUtils.
The upstream replacement XmlSupport adds considerable dependencies
and complexity that would have no apparent behavioral benefit on
Android.

Test: PropertiesTest
Test: Verified that testTrailingBackslash() fails if
the first fix is commented out.
Test: Verified that testTrailingBackslashAndNewline()
fails if the second fix is commented out.

Bug: 29935305

Change-Id: I93a4b879c10909d31585320af9b0d5c1fe7e46b8
roperties.java
f48d1bd677a2a116b0e743348e2ab8ad19a54b31 21-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Random to OpenJDK8u60" am: 56f0ed66b3 am: 933526389f
am: 4d2f4d0efc

Change-Id: I8bbfd0c727f2f7c3431a7cc558caac5c31739886
4d2f4d0efc9914790a71c33d9925f07a1f9ed452 21-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Random to OpenJDK8u60" am: 56f0ed66b3
am: 933526389f

Change-Id: Ifa17a0e4de78ee28efa1242a15df1f3be044da57
7ff253db3117067931e9f249762812de7f3bf694 06-Sep-2016 Tobias Thierer <tobiast@google.com> Update ResourceBundle related classes from java.util to OpenJDK8u60

Documented several previously undocumented Android-changed sections
that were missed in the initial draft of this CL.

- ResourceBundle
Added test for new method getBaseBundleName().
Added missing Android-changed comment for:
- use of UTF-8 for PropertyResourceBundles
- use of getLoader(VMStack.getCallingClassLoader())
- spi.ResourceBundleControlProvider
- PropertyResourceBundle, ListResourceBundle
Android-changed: Made access to the 'lookup' field thread safe.
- ServiceLoader
Do not use legacy security code.
Added missing Android-changed comments for loadFromSystemProperty()
and for fail() invocations where Android passes a 'Throwable cause'.

Bug: 29935305

Test: run cts -m CtsLibcoreTestCases

Change-Id: Idc3a7c5513644dd103e7d132789d37a1c40f1471
istResourceBundle.java
ropertyResourceBundle.java
esourceBundle.java
erviceLoader.java
pi/ResourceBundleControlProvider.java
37db1d741fe624b67fb432aa453019c9a879a6f7 20-Sep-2016 Tobias Thierer <tobiast@google.com> Update Random to OpenJDK8u60

This file is now exactly identical to upstream.

- parameter n was renamed to bound
- The while loop in nextInt() was refactored to
an equivalent for loop (note the assignment in
the loop condition).
- nextDouble() now multiplies * 0x1.0p-53
instead of dividing / (1L << 53)

Bug: 29935305

Test: vogar libcore.java.util.RandomTest
Test: vogar org.apache.harmony.tests.java.util.RandomTest

Change-Id: Ibfd65465305b1fc23cbe03317adfecb3045f9a00
andom.java
537af6abf1af39e6dc7c337245c7b1d57a118fe4 13-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update six more classes from java.util to OpenJDK8u60" am: 39f3deef2d am: a351ada4f9
am: 59afbebe5b

Change-Id: Idc8c23b748ac3495e3d7377b708ad0b200c4df0f
59afbebe5ba7e45bf9c148990590a601294812b0 13-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update six more classes from java.util to OpenJDK8u60" am: 39f3deef2d
am: a351ada4f9

Change-Id: I929d0008297b2139d756058491feb8404e2d3ce9
e64b86797d2d2a6d0272de808105cee476b13e18 06-Sep-2016 Tobias Thierer <tobiast@google.com> Update six more classes from java.util to OpenJDK8u60

Minor tweaks only, no behavior changes. All of these classes are now
exactly identical to upstream.

Added a test. Removed an old test that didn't add any value since it
forgot a fail() (so it didn't test what it intended to test) and
since it was only duplicating functionality in the new test.

- Formattable
- IllegalFormatConversionException
- InvalidPropertiesFormatException
Note that the serialVersionUID appears pointless since, per both
the documentation as well as the implementations of writeObject()
and readObject(), this class does not support serialization.
- MissingFormatWidthException
- NoSuchElementException
- TimerTask

Bug: 29935305
Test: vogar libcore.java.util.InvalidPropertiesFormatExceptionTest
Change-Id: I822ad261c4cb2b56cae52e6386dae1f9239d5356
ormattable.java
llegalFormatConversionException.java
nvalidPropertiesFormatException.java
issingFormatWidthException.java
oSuchElementException.java
imerTask.java
046ddd5efe5715ec47bb14423caf7a160a407150 12-Sep-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix ZipFile exception for non-existent files am: d95a908045
am: 0891418a56

Change-Id: I3467c0462337975f3b06f354cf91691df9a4ac98
d95a908045486d862dfe0be056dd4ecfb3bd7693 25-Aug-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix ZipFile exception for non-existent files

This change fixes N regression in java.util.zip.ZipFile constructor.
In previous android releases, for non-existent files, ZipFile
constructor was throwing FileNotFoundException. Due to
change in commit adc40417389a57bc7a831f55334bffcc07343eb9,
N started to use ZipException in this case. This change
reverts to pre-N behavior.

Test: libcore.java.util.zip.ZipFileTest
Bug: 31077136
Change-Id: I7c7240d0808552f4e0cf4ed4ccbda7537df2d2b1
ip/ZipFile.java
a6ba9927ffd94854f86b842d0cb663a388df0c63 09-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Scanner to OpenJDK8u60" am: 0584eda73e
am: 745715f1fc

Change-Id: Ia7f73db635eaea23a9f3e235a0d0f306f71c2375
0584eda73e32ad542059c3ab250442a9edac860d 09-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Scanner to OpenJDK8u60"
a705860d86707af452105b70a3b7c8101d76df32 09-Sep-2016 Tobias Thierer <tobiast@google.com> Update Observable to OpenJDK8u60. am: 8de20a2d60
am: 7f25447649

Change-Id: I4600ae086f8dc26ef8666a53b85d3151a4a8fcc3
3ae97aeb6b9499f4ec5a598186f021441ac043e7 09-Sep-2016 Tobias Thierer <tobiast@google.com> Revert "Observable: Clean up and generify observable." am: 68dfa5d47f
am: 207f6e5dd1

Change-Id: I6d3883addc3dd0c1d607a0d2295b4717255fc41e
8dece7e10a540ac37ed26bbb8f317b18f8e8134a 07-Sep-2016 Tobias Thierer <tobiast@google.com> Update Scanner to OpenJDK8u60

Documentation changes only.

All six Android-changed sections were kept (two of them previously
said "Android changed" without the "-", those were made consistent).

Test: run cts -m CtsLibcoreTestCases \
-t org.apache.harmony.tests.java.util.ScannerTest

Change-Id: I0a144c5869aac666fc7d08e573c7f0c9c5d4407c
canner.java
8de20a2d6076e8b5827434d8e1283665a53d160c 06-Sep-2016 Tobias Thierer <tobiast@google.com> Update Observable to OpenJDK8u60.

Reverted comment parts of fbabe73723c24c38cbfd6429387dae5e6478513f
Added missing Android-changed comment for the behavior parts of
that CL.

This CL does not change behavior.

Test: treehugger build succeeds
Bug: 29935305

Change-Id: I40d19bd4357eadc1016df4ab505c6349d516944b
bservable.java
68dfa5d47f21dba4f403e2cb644e6f34254acc3e 08-Sep-2016 Tobias Thierer <tobiast@google.com> Revert "Observable: Clean up and generify observable."

This reverts commit 637199ac0a9cdee94d6293ee4267ce6e14bec495.

Test: flashed device boots successfully

Change-Id: I88081683974ec434cd3f44fc859dd21000f1b213
bug: 26937230
bservable.java
c437b5f7885f646e1beff15224ced039aa860402 08-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Add java.util.Base64 from OpenJDK8u60" am: 43953a0c28
am: 42248a684b

Change-Id: I910b697ea41e8bbb406e3af4b8261713f9c52bd8
43953a0c281b6dd4c354b2a670512eee4b105f3e 08-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Add java.util.Base64 from OpenJDK8u60"
99fdd3027b42aa9e24436db5b6ee12f5a16c0c75 08-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Collection.java to OpenJDK8u60" am: b5ccf73d9a
am: c128222e39

Change-Id: I5746668660fa222bd37b5cc6c0116680fdc278b0
b5ccf73d9ad28e2ed5a391ff74011c67ec0c8734 08-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update Collection.java to OpenJDK8u60"
31e849edba4cc4f6d8af2f322dee273ff2fe0734 07-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update BitSet, ConcurrentModificationException, UUID to OpenJDK 8u60." am: ce7b9009e7
am: a7836677f3

Change-Id: I34a04149e8d3bbdfab607e6a35568e89020b19a8
ce7b9009e7da1e65fb6727ca00a79682d8f81e54 07-Sep-2016 Tobias Thierer <tobiast@google.com> Merge "Update BitSet, ConcurrentModificationException, UUID to OpenJDK 8u60."
72214c4b172cc73585fbb7beae91ed0853cbfe24 31-Aug-2016 Tobias Thierer <tobiast@google.com> Update Collection.java to OpenJDK8u60

Documentation tweaks only. The file is now identical to upstream
modulo the {@docRoot} link in the documentation.

Test: Checked that treehugger build succeeded
Bug: 29935305

Change-Id: I525565d510b13323e2f9cce5188a172e4b304ce2
ollection.java
7e1572c1b972383fa200d93a65a27767eb1b3cb8 06-Sep-2016 Tobias Thierer <tobiast@google.com> Merge changes Ibf410fa1,Ib8f90804 am: 10aea9e92e
am: bb4544d110

Change-Id: I8064f0978a5e640482d596482656fc9a3f6d1443
88bb8a43d0c963be515d6e1768d4a3418c910bc0 01-Sep-2016 Tobias Thierer <tobiast@google.com> Add java.util.Base64 from OpenJDK8u60

The test was resurrected from abandoned CL http://r.android.com/93059
but was expanded and refactored.

libcore.os.Base64 should not be used for new code so it was marked
deprecated.

Test: vogar libcore/luni/src/test/java/libcore/java/util/Base64Test.java
Bug: 29935305

Change-Id: I37fa256a50f7ee8bae21cccf6a0db04dd0a117de
ase64.java
a6045fc041c427f90797e79401b6e1d227c6d5ce 05-Sep-2016 Tobias Thierer <tobiast@google.com> Revert change to WeakHashMap.hash()

The change from commit bfada6f78af63fd626be6991c696cb0393289686
is no longer necessary on Android. The implementation of
WeakHashMap.hash() is now identical with OpenJDK8u60.

Test: cts-tradfed run cts -m CtsLibcoreTestCases

Bug: 28082128
Bug: 29935305
Change-Id: Ibf410fa108fcbe1ea0a898c092559f2874e7912b
eakHashMap.java
bb9f276b1424e2c99789a2d6932cab8726bf2e07 31-Aug-2016 Tobias Thierer <tobiast@google.com> Update WeakHashMap to OpenJDK8u60.

Refactoring tweaks only, no behavioral changes vs. previous version.

Moved the hash calculation back out into a hash() helper function
but kept Android's implementation from AOSP commit
bfada6f78af63fd626be6991c696cb0393289686
This made it easier to document the use of the particular hash
function with "Android-changed".

Bug: 29935305
Test: Ran the following two tests with vogar:
harmony-tests/src/test/java/org/apache/harmony/tests/java/util/WeakHashMapTest.java
luni/src/test/java/libcore/java/util/WeakHashMapTest.java

Change-Id: Ib8f90804776b435877ab58a8137886f7b7752186
eakHashMap.java
3541004c1812f84845a6b072ac45801302a099fb 24-Aug-2016 Tobias Thierer <tobiast@google.com> Update BitSet, ConcurrentModificationException, UUID to OpenJDK 8u60.

All three files are now exactly identical to upstream.

The BitSet change fixes BitSet.toString() in the case where bit #
Integer.MAX_VALUE is set. On previous versions of Android, this
would have thrown IndexOutOfBoundsException when the bit index
overflowed; it now works as expected.

This change is desirable and carries practically no app compat risk:
The bug requires a 256 MByte BitSet which is larger than the maximum
of 200 MBytes of heap that Android allows on a Nexus 6P with 3 GB RAM,
unless one requests a larger heap in the manifest.

Test: Manually confirmed that when the new test is run from Android
Studio on a with android:largeHeap="true" in the manifest,
it throws IndexOutOfBoundsException when run on Android M but
passes on a Nexus 6P after this CL.

Confirmed that it passes in vogar (it will have been skipped
for lack of heap memory).

Bug: 29935305
Bug: 31234459

Change-Id: I9b0f662b209332be06a3b6a784b63deefefb13d1
itSet.java
oncurrentModificationException.java
UID.java
618cb328d2a039cb4199ff2dc7ba67ca7928d7af 24-Aug-2016 Narayan Kamath <narayan@google.com> ZipFile: Never change file offset during I/O operations.
am: 36d0742869

Change-Id: Ic50ac8aa2be693ea847833a86942f6c10d93fd1c
36d074286912d876489c6ff21bc0c41016180dad 18-Aug-2016 Narayan Kamath <narayan@google.com> ZipFile: Never change file offset during I/O operations.

Use pread instead read and eliminate unnecessary calls to lseek.

dalvik.system.VMClassLoader maintains a cache of JarFile objects
that it creates whenever it loads resources from them. This cache may
be populated in the zygote as a side effect of preloading classes. When
processes are forked from the zygote, the file descriptors associated
with these JarFile objects point to the same kernel file description
and may end up stepping on each others toes. To avoid such issues, we
never make any offset changes to the associated file.

Note that we have a guarantee that the file will never be closed in
any forked process because the associated JarFile objects can never be
collected.

test: run cts -m CtsLibcoreTestCases / ZipStressTest / manual testing
to trigger the race condition.

bug: 30407219
bug: 30904760

(cherry picked from commit 0393d3c84ed9bd24bcf0dac3782a1cc23400ace8)

(cherry picked from commit 50c5924a4a1f78b7722d97dc958317027e25e214)

Change-Id: I1d2be54e768f668616e5b53e038d80fab5aa7e18
ip/ZipFile.java
7769b8216cc8056a253d8c8a427cf10d45ff7ef0 24-Aug-2016 Tobias Thierer <tobiast@google.com> Merge "Update {Regular,Jumbo}EnumSet to OpenJDK8u60"
1944d49528a6c390c283f18f42747b849a0fd796 24-Aug-2016 Tobias Thierer <tobiast@google.com> Merge changes I28869ab7,I1d2bfbb4,Id0820e75,Id696a41b

* changes:
Update ArrayList to OpenJDK8u60
Update List to OpenJDK8u60.
Update EnumMap and EnumSet OpenJDK8u60
Update misc collection related classes to OpenJDK8u60
dbd5f6a921c3f504b7626030babd0d6856b1275e 23-Aug-2016 Tobias Thierer <tobiast@google.com> Update {Regular,Jumbo}EnumSet to OpenJDK8u60

Only cosmetic changes. No Android-changed sections.

Test: make succeeds

Bug: 29935305
Change-Id: Ic389e4c55d1c95e6aac752f3a7996e61e65b3b0b
umboEnumSet.java
egularEnumSet.java
08e9e364940586cb242839c8f0e303b82438f58b 19-Aug-2016 Tobias Thierer <tobiast@google.com> Fix regression in Vector.listIterator.add() introduced in N.

AOSP commit 887ab3fe607c582e10e33b3d631401d7a791aaed touched Vector.Itr
to fix an app compability bug, but did not make a corresponding change
to Vector.ListItr which extends Vector.Itr. Specifically, ListItr.add()
does not account for the extra element in the hasNext() logic that it
inherits from the super class. This causes iteration to terminate
prematurely when an element was added via the ListIterator.

This CL fixes the regression by incrementing limit during ListItr.add().

Bug: 27430229
Bug: 30974375

Test: VectorTest
Test: 842 guava-testlib tests for Vector; coverage for Vector was
contributed to guava-testlib in http://cl/130778873

(cherry picked from commit c13c9eddc3f7eeb760fcd9032b85ef2767cc82ba)

Change-Id: I9a565f11f7b8b7368cf967d66e986d6130e17267
ector.java
c423a5444e5601eb3ef2bcfbf7ceee3b28e41665 22-Aug-2016 Tobias Thierer <tobiast@google.com> Update ArrayList to OpenJDK8u60

Added missing Android-changed comments.

Test: Ran the following at a follow-up CL that used this CL
as a base.
1.) run cts -p android.core.tests.libcore.package.libcore
2.) guava-testlib tests for java.util List/Map/Set/Queue
implementations

Bug: 29935305

Change-Id: I28869ab79a3bc190c37198b0cece0d89761a3634
rrayList.java
dc1be9dbce3f33315883fe4fa8108c33af7cc119 19-Aug-2016 Tobias Thierer <tobiast@google.com> Update List to OpenJDK8u60.

Order of default methods was changed. It now matches upstream.

Android's sort() implementation was kept for consistency with
the current documentation in Android.
Upstream's documentation is not consistent with upstream's
implementation.

Test: Ran the following at a follow-up CL that used this CL
as a base.
1.) run cts -p android.core.tests.libcore.package.libcore
2.) guava-testlib tests for java.util List/Map/Set/Queue
implementations

Bug: 29935305

Change-Id: I1d2bfbb4bc7fd4d9c8cf8d7f75357915624a3d85
ist.java
7e0da07ffc05a8773965dfc17f7f61eb616483a1 22-Aug-2016 Tobias Thierer <tobiast@google.com> Update EnumMap and EnumSet OpenJDK8u60

This CL makes no behavior changes.

The single Android-changed section in each of these files was kept.

Test: Ran the following at a follow-up CL that used this CL
as a base.
1.) run cts -p android.core.tests.libcore.package.libcore
2.) guava-testlib tests for java.util List/Map/Set/Queue
implementations

Bug: 29935305

Change-Id: Id0820e75ec1c781cc10b2d4a505cc4117f6de92f
numMap.java
numSet.java
fee325d834eb37a26761e849c9becd7b9b4d3a12 22-Aug-2016 Tobias Thierer <tobiast@google.com> Update misc collection related classes to OpenJDK8u60

This covers:

AbstractCollection
AbstractMap
AbstractList
AbstractSet
LinkedList
ListIterator
SortedMap

None of these classes have any Android-changed sections.

Test: Ran the following at a follow-up CL that used this CL
as a base.
1.) run cts -p android.core.tests.libcore.package.libcore
2.) guava-testlib tests for java.util List/Map/Set/Queue
implementations

Bug: 29935305

Change-Id: Id696a41b8e48c38ef279c9854838f1b076f6df9c
bstractCollection.java
bstractList.java
bstractMap.java
bstractSet.java
inkedList.java
istIterator.java
ortedMap.java
c13c9eddc3f7eeb760fcd9032b85ef2767cc82ba 19-Aug-2016 Tobias Thierer <tobiast@google.com> Fix regression in Vector.listIterator.add() introduced in N.

AOSP commit 887ab3fe607c582e10e33b3d631401d7a791aaed touched Vector.Itr
to fix an app compability bug, but did not make a corresponding change
to Vector.ListItr which extends Vector.Itr. Specifically, ListItr.add()
does not account for the extra element in the hasNext() logic that it
inherits from the super class. This causes iteration to terminate
prematurely when an element was added via the ListIterator.

This CL fixes the regression by incrementing limit during ListItr.add().

Bug: 27430229
Bug: 30974375

Test: VectorTest
Test: 842 guava-testlib tests for Vector; coverage for Vector was
contributed to guava-testlib in http://cl/130778873

Change-Id: I1e2042ebfd78a4956791bd43d60db7d1dec8edf5
ector.java
5e590c486de72c6f7569cdfb984c7e2cd35b43a8 19-Aug-2016 Tobias Thierer <tobiast@google.com> Update Vector to JDK8u60.

- Position of replaceAll() and sort() implementation in the file
now matches upstream.
- Added a missing "Android changed" comment.

Test: cts-tradefed run cts -p android.core.tests.libcore.package.libcore

Bug: 29935305

Change-Id: Ibe48287ac4f51528c4aa8fe81ed334116d2607be
ector.java
b7614d4830d62ea3980797669e69ade24ac0d98c 16-Aug-2016 Tobias Thierer <tobiast@google.com> Update TreeMap to OpenJDK8u60.

All existing local changes were kept:

* toplevel documentation link via openjdk-redirect.html

* naming of nested class TreeMapEntry
- added a test
- added an Android-changed comment block

* value of NavigableSubMap.serialVersionUID

* range checks for tailMap() / headMap()
- changed "BEGIN android" comment format to the more common
(640 vs. 69 occurences) format "Android-changed BEGIN".
- these are covered by the tests added in AOSP commit
26b39cc71ae9c0890b1c56f7062debd4b555811c

Existing tests in HashtableTest and LinkedHashMapTest differed
slightly from the new tests in TreeMapTest, so they were tweaked
to make them consistent.

Test: cts-tradefed run cts -p android.core.tests.libcore.package.libcore
Test: Guava 19.0 guava-testlib's testForTreeMapNatural() and
testsForTreeMapWithComparator() (96850 test methods run).

Bug: 29935305

Change-Id: Ia5064afa38c64b8ca0d08a91d1766958da58d6e6
reeMap.java
0393d3c84ed9bd24bcf0dac3782a1cc23400ace8 18-Aug-2016 Narayan Kamath <narayan@google.com> ZipFile: Never change file offset during I/O operations.

Use pread instead read and eliminate unnecessary calls to lseek.

dalvik.system.VMClassLoader maintains a cache of JarFile objects
that it creates whenever it loads resources from them. This cache may
be populated in the zygote as a side effect of preloading classes. When
processes are forked from the zygote, the file descriptors associated
with these JarFile objects point to the same kernel file description
and may end up stepping on each others toes. To avoid such issues, we
never make any offset changes to the associated file.

Note that we have a guarantee that the file will never be closed in
any forked process because the associated JarFile objects can never be
collected.

test: run cts -m CtsLibcoreTestCases / ZipStressTest / manual testing
to trigger the race condition.

bug: 30407219
Change-Id: Ic770a6ab6aca7f123a90002327d7f0a321e9afef
ip/ZipFile.java
b6f0af5267f95ad4e208f6df65c58899dc51c767 18-Aug-2016 Tobias Thierer <tobiast@google.com> Merge "Revert "Workaround bogus TreeMap Comparators.""
7b9eae835b3780b8eb73c59106aaf8a84e3e4938 18-Aug-2016 Tobias Thierer <tobiast@google.com> Merge "Update Hashtable to OpenJDK8u60."
7069990696f3528116df316db58aa3df5d020674 18-Aug-2016 Tobias Thierer <tobiast@google.com> Merge "Update IdentityHashMap to OpenJDK8u60"
05996f439bd1ef46bdf834875b6b29b02f7bb999 16-Aug-2016 Tobias Thierer <tobiast@google.com> 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
ashtable.java
3733bc930b4f8a02b278dde1109d0cd42f7c4c08 17-Aug-2016 Tobias Thierer <tobiast@google.com> Revert "Workaround bogus TreeMap Comparators."

This was a temporary workaround for app compatibility in Android N.

Bug: 27913360
Test: cts-tradefed run cts -p android.core.tests.libcore.package.libcore

This reverts commit 78562a12977fc4d81cd31e7c5af05d66bb701ccd.

Change-Id: Ib03ee04d17da5d2b8e943c2da9b7351f852ce716
reeMap.java
7e4402ce0795aea32d680df3a49fc06bbd7d4f0b 16-Aug-2016 Tobias Thierer <tobiast@google.com> Update IdentityHashMap to OpenJDK8u60

After this change, IdentityHashMap.java is identical to the
upstream version except for the openjdk-redirect.html in the
top level documentation.

Previously, the class was a mix of OpenJDK8u60 and OpenJDK7u40
code.

Test: all libcore tests (IHM is not covered by guava-testlib)

Change-Id: I10cc1c19b2bd88897dba4ad1dbfe95d938c602d3
dentityHashMap.java
9efb6d12ce4d2ffedb73d6e9887ea2c89f8ec129 08-Jun-2016 Narayan Kamath <narayan@google.com> Update HashMap, HashSet, LinkedHashMap to JDK8u60.

Added tests for:
- entrySet()/keySet()/values() spliterators (LinkedHashMap
has completely new implementations)
- LinkedHashMap.eldest (Android specific API, previously
existed but was untested)
- naming of nested class LinkedHashMap.LinkedHashMapEntry
- tweaked test for Map.getOrDefault() method so it's useful
for LinkedHashMap

This CL doesn't touch HashSetTest since it already covered
spliterator() and serialization.

Test: Ran all libcore tests.

Bug: 29935305
Change-Id: I9d991a08c403b83b15e9c88ce97cbd5cd77a8bcf
ashMap.java
ashSet.java
inkedHashMap.java
62e3fcccb91fa405516e6288239590ebac210dea 11-Aug-2016 Tobias Thierer <tobiast@google.com> Revert "Change LinkedHashMap#removeEldestEntry behaviour."

This reverts commit 9c4d5752a75ab0f1fa37aac2984629bf30cafa94.

Bug: 27964914
Change-Id: I984b093607128ba2de5f4a85c911f8106cd36a1a
inkedHashMap.java
fde01e06d8aacfc18c2d4bf1930e271ae5c812d1 02-Aug-2016 Yi Kong <yikong@google.com> Remove unnecessary +x flag

Source code files and serialized resource files should not have x flag set.

This is a follow up to commit 49965c1d, where native codes and some Java
source files are left out.

Bug: 29977629
Test: Build, CTS tests
Change-Id: I475491284cf5784ed499daa434c2845cdadea3a0
ar/package.html
ogging/package.html
ackage.html
refs/package.html
egex/package.html
pi/package.html
ip/package.html
49965c1dc9da104344f4893a05e45795a5740d20 30-Jun-2016 Ganesh Mahendran <opensource.ganesh@gmail.com> remove x attribute of java file

java file does not need x attribute. This patch removes it.

Change-Id: I2a7170d99f4bee7a7b819621c84dd197ded37fa2
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
bstractCollection.java
bstractList.java
bstractMap.java
bstractSequentialList.java
bstractSet.java
rrayList.java
rrays.java
itSet.java
alendar.java
ollection.java
omparableTimSort.java
oncurrentModificationException.java
urrency.java
ate.java
ictionary.java
ualPivotQuicksort.java
uplicateFormatFlagsException.java
mptyStackException.java
numMap.java
numSet.java
numeration.java
ventListener.java
ventListenerProxy.java
ventObject.java
ormatFlagsConversionMismatchException.java
ormattable.java
ormattableFlags.java
ormatter.java
ormatterClosedException.java
regorianCalendar.java
ashMap.java
ashSet.java
ashtable.java
dentityHashMap.java
llegalFormatCodePointException.java
llegalFormatConversionException.java
llegalFormatException.java
llegalFormatFlagsException.java
llegalFormatPrecisionException.java
llegalFormatWidthException.java
llformedLocaleException.java
nputMismatchException.java
nvalidPropertiesFormatException.java
terator.java
umboEnumSet.java
inkedHashMap.java
inkedHashSet.java
inkedList.java
ist.java
istIterator.java
istResourceBundle.java
ocale.java
issingFormatArgumentException.java
issingFormatWidthException.java
issingResourceException.java
oSuchElementException.java
bjects.java
bservable.java
bserver.java
roperties.java
ropertyPermission.java
ropertyResourceBundle.java
andom.java
andomAccess.java
egularEnumSet.java
esourceBundle.java
canner.java
erviceConfigurationError.java
erviceLoader.java
et.java
impleTimeZone.java
ortedMap.java
ortedSet.java
tack.java
tringTokenizer.java
imSort.java
imeZone.java
imer.java
imerTask.java
ooManyListenersException.java
reeMap.java
reeSet.java
UID.java
nknownFormatConversionException.java
nknownFormatFlagsException.java
ector.java
eakHashMap.java
MLUtils.java
ar/Attributes.java
ar/JarEntry.java
ar/JarException.java
ar/JarFile.java
ar/JarInputStream.java
ar/JarOutputStream.java
ar/JarVerifier.java
ar/Manifest.java
ar/Pack200.java
ogging/ConsoleHandler.java
ogging/ErrorManager.java
ogging/FileHandler.java
ogging/Filter.java
ogging/Formatter.java
ogging/Handler.java
ogging/Level.java
ogging/LogManager.java
ogging/LogRecord.java
ogging/Logger.java
ogging/Logging.java
ogging/LoggingMXBean.java
ogging/LoggingPermission.java
ogging/LoggingProxyImpl.java
ogging/MemoryHandler.java
ogging/SimpleFormatter.java
ogging/SocketHandler.java
ogging/StreamHandler.java
ogging/XMLFormatter.java
refs/AbstractPreferences.java
refs/BackingStoreException.java
refs/Base64.java
refs/FileSystemPreferences.java
refs/FileSystemPreferencesFactory.java
refs/InvalidPreferencesFormatException.java
refs/NodeChangeEvent.java
refs/NodeChangeListener.java
refs/PreferenceChangeEvent.java
refs/PreferenceChangeListener.java
refs/Preferences.java
refs/PreferencesFactory.java
refs/XmlSupport.java
egex/MatchResult.java
egex/Matcher.java
egex/Pattern.java
egex/PatternSyntaxException.java
pi/CurrencyNameProvider.java
pi/LocaleNameProvider.java
pi/LocaleServiceProvider.java
pi/TimeZoneNameProvider.java
ip/Adler32.java
ip/CRC32.java
ip/CheckedInputStream.java
ip/CheckedOutputStream.java
ip/Checksum.java
ip/DataFormatException.java
ip/Deflater.java
ip/DeflaterInputStream.java
ip/DeflaterOutputStream.java
ip/GZIPInputStream.java
ip/GZIPOutputStream.java
ip/Inflater.java
ip/InflaterInputStream.java
ip/InflaterOutputStream.java
ip/ZStreamRef.java
ip/ZipCoder.java
ip/ZipConstants.java
ip/ZipConstants64.java
ip/ZipEntry.java
ip/ZipError.java
ip/ZipException.java
ip/ZipFile.java
ip/ZipInputStream.java
ip/ZipOutputStream.java
694e617f54a7bfbdad24913ce96f5d56f1a1960a 20-Jun-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port openJdk8 java.lang package, part 2

- Removed floating to/from string performance hacks
we have added on the top of openJdk7 code (no longer needed)
- AbstractStringBuilder is Appendable again, we may decide
to revert this (see b/27582395 for context)
- New String method #join

Bug: 28666126
Change-Id: I35f6dbc1199e2bd2b4a4db69d35da81679d80093
ormatter.java
cb3716a2cf5f9ee3fe6faa5d07a1a1d1329a171a 09-Jun-2016 Felipe Leme <felipeal@google.com> Added cast to flatten() argument.

Without it, Eclipse compiler fails.

BUG: 29399275

Change-Id: I08d5df4d2979acc1c4147fb55bc7b6e0c56383d9
tream/ReferencePipeline.java
e34fbfb66a724284a9722892fa8f51f7c663ed86 13-Jun-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix Preferences regression.

This change fixes reading filesystem-saved
java.util.prefs.Preferences.

Due to a bug in XmlSupport, when reading the
filesystem-saved preferences, the reader was
throwing an exception. The Android
implementation of xml parser adds additional
nodes that were not Elements, this was
causing a cast exception (the old code was expecting
only Elements).

FileSystemPreferences class was swallowing exceptions if
they happen during preferences content reading.
This changes adds additional logging to prevent this.

Bug: 27645233
Change-Id: Ieebd8a6a1002111654005bfcc42009b01c89ea70
(cherry picked from commit 44d29b0a9012a66f5db5a8130017568a55c11668)
refs/FileSystemPreferences.java
refs/XmlSupport.java
774864c67ad84bb556104bfd204d59506a333246 13-Jun-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Fix Preferences regression."
44d29b0a9012a66f5db5a8130017568a55c11668 13-Jun-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix Preferences regression.

This change fixes reading filesystem-saved
java.util.prefs.Preferences.

Due to a bug in XmlSupport, when reading the
filesystem-saved preferences, the reader was
throwing an exception. The Android
implementation of xml parser adds additional
nodes that were not Elements, this was
causing a cast exception (the old code was expecting
only Elements).

FileSystemPreferences class was swallowing exceptions if
they happen during preferences content reading.
This changes adds additional logging to prevent this.

Bug: 27645233
Change-Id: Ieebd8a6a1002111654005bfcc42009b01c89ea70
refs/FileSystemPreferences.java
refs/XmlSupport.java
d8ee6328b19fc8f646cd7adcf43c72c982aafbe9 10-Jun-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Mark broken Preferences methods as legacy code.

Bug: 27645233
Bug: 27441320
Change-Id: I78422f4314ad082adbd983e04510d4dfabe9792d
(cherry picked from commit e81ecfe346f82a8abd6546523a2bdc9de3ce6c92)
refs/Preferences.java
e81ecfe346f82a8abd6546523a2bdc9de3ce6c92 10-Jun-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Mark broken Preferences methods as legacy code.

Bug: 27645233
Bug: 27441320
Change-Id: I78422f4314ad082adbd983e04510d4dfabe9792d
refs/Preferences.java
e6bac4bf9c85c2454ce22c91da6c654552c268e0 20-May-2016 Shubham Ajmera <shubhamajmera@google.com> Add OpenJDK 8 java.nio.file package

Based on openJdk 8u60 except java.nio.FileTime. JDK8 FileTime is
dependent on java.time package which is yet to be added, therefore, it
is taken from openJdk 7u40.

Bug: 27331465
Change-Id: If6969ad38edb1e160f2918bb40c94579a43f0346
canner.java
b2c91e9c9a3ee9872f85611bac3b98bbf5dddc51 26-May-2016 Joachim Sauer <jsauer@google.com> Sync default timezone to ICU.

When java.util.TimeZone.setDefault() is called (either by client code or
from ActivityThread.updateTimeZone due to ACTION_TIMEZONE_CHANGED) we
need to notify android.icu.util.TimeZone of this change, as it keeps a
cached android.icu.util.TimeZone object to represent that default value.

android.icu.util.TimeZone.setTimeZone would be the obvious candidate
here. Unfortunately that method was hidden to have a single consistent
way to set the timezone and tries to do some extra work that is
undesireable on Android.

To avoid potential loops of ICU setDefault calling JDK setDefault and
vice versa, we remove the ICU setDefault.

Bug: 28949992

(cherry picked from commit f59264d36afd660c69d3b9dff46bc35d57e7c94f)

Change-Id: Iaa63c2d77a4d345ee9af2d7d0c268746f6c101d3
imeZone.java
75fc6a28c1cb11fa992309b7d2d48b49337c2de3 27-May-2016 Joachim Sauer <jsauer@google.com> Merge "Sync default timezone to ICU." into nyc-dev
a128ef7c6913e8b5f2ef4678ade5f97d7f7f452f 26-May-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix java.util.zip.ZipFile with OPEN_DELETE.

openJdk java.util.zip.ZipFile with OPEN_DELETE flag
uses unlink to remove the file just after it's opened.

This is causing trouble on /storage partition, we
can read/write unlinked file easily, but lseek seems
to fail with ENOENT.

This change introduces alternative implementation that
doesn't use unlink before closing the file.

Bug: 28901232
Bug: 28950284
Change-Id: I871a84e9a14bc1b4b9d5b0faa207579e27bcfc81
(cherry picked from commit ae6b1b85c67401fc9d986c3ffb7d9e8a9c804c30)
ip/ZipFile.java
f59264d36afd660c69d3b9dff46bc35d57e7c94f 26-May-2016 Joachim Sauer <jsauer@google.com> Sync default timezone to ICU.

When java.util.TimeZone.setDefault() is called (either by client code or
from ActivityThread.updateTimeZone due to ACTION_TIMEZONE_CHANGED) we
need to notify android.icu.util.TimeZone of this change, as it keeps a
cached android.icu.util.TimeZone object to represent that default value.

android.icu.util.TimeZone.setTimeZone would be the obvious candidate
here. Unfortunately that method was hidden to have a single consistent
way to set the timezone and tries to do some extra work that is
undesireable on Android.

To avoid potential loops of ICU setDefault calling JDK setDefault and
vice versa, we remove the ICU setDefault.

Bug: 28949992
Change-Id: I46a59551864cd2b780f72d28e01a0c39daf3aef5
imeZone.java
ae6b1b85c67401fc9d986c3ffb7d9e8a9c804c30 26-May-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix java.util.zip.ZipFile with OPEN_DELETE.

openJdk java.util.zip.ZipFile with OPEN_DELETE flag
uses unlink to remove the file just after it's opened.

This is causing trouble on /storage partition, we
can read/write unlinked file easily, but lseek seems
to fail with ENOENT.

This change introduces alternative implementation that
doesn't use unlink before closing the file.

Bug: 28901232
Bug: 28950284
Change-Id: I871a84e9a14bc1b4b9d5b0faa207579e27bcfc81
ip/ZipFile.java
e03b33ae5072a36e38f2d4a02b4ceb92f29d167e 20-May-2016 Narayan Kamath <narayan@google.com> Observable: Call out to hasChanged() to figure out if something changes.

bug: 28797950

(cherry picked from commit fbabe73723c24c38cbfd6429387dae5e6478513f)

Change-Id: I8dd1cccce31d440782a8b7a6210a89576febbdaa
bservable.java
fbabe73723c24c38cbfd6429387dae5e6478513f 20-May-2016 Narayan Kamath <narayan@google.com> Observable: Call out to hasChanged() to figure out if something changes.

bug: 28797950
Change-Id: I3362243c63f72e05ebd72f9243a2d45aa7734c6a
bservable.java
309f9df28350e15445b9135e8b710fa2b34b5dc1 25-Apr-2016 Yi Kong <yikong@google.com> Update URLs to Java technotes and platform docs

Fix links to {@docRoot}/../{technotes,platform} pages.

This is done by batch editing using the following script:
grep @docRoot -rl | xargs sed -i 's/\/..\/technotes/r\/openjdk-redirect.html?v=8\&path=\/technotes/g;s/\/..\/platform/openjdk-redirect.html?v=8\&path=\/platform/g'

Bug: 27540501
Change-Id: Ib5634cd461fbba37dd94ddad9660910dc9397fe7
(cherry picked from commit d2449bb576ad1e3a3877364e5e1ae28625f69e35)
bstractCollection.java
bstractList.java
bstractMap.java
bstractSequentialList.java
bstractSet.java
rrayList.java
rrays.java
ollection.java
ollections.java
omparator.java
numMap.java
numSet.java
ashMap.java
ashSet.java
ashtable.java
dentityHashMap.java
terator.java
inkedHashMap.java
inkedHashSet.java
inkedList.java
ist.java
istIterator.java
riorityQueue.java
roperties.java
andomAccess.java
et.java
ortedMap.java
ortedSet.java
reeMap.java
reeSet.java
ector.java
eakHashMap.java
ar/Attributes.java
ar/Manifest.java
ar/Pack200.java
ar/package.html
ogging/package.html
ackage.html
pi/LocaleServiceProvider.java
d2449bb576ad1e3a3877364e5e1ae28625f69e35 25-Apr-2016 Yi Kong <yikong@google.com> Update URLs to Java technotes and platform docs

Fix links to {@docRoot}/../{technotes,platform} pages.

This is done by batch editing using the following script:
grep @docRoot -rl | xargs sed -i 's/\/..\/technotes/r\/openjdk-redirect.html?v=8\&path=\/technotes/g;s/\/..\/platform/openjdk-redirect.html?v=8\&path=\/platform/g'

Bug: 27540501
Change-Id: Ib5634cd461fbba37dd94ddad9660910dc9397fe7
bstractCollection.java
bstractList.java
bstractMap.java
bstractSequentialList.java
bstractSet.java
rrayList.java
rrays.java
ollection.java
ollections.java
omparator.java
numMap.java
numSet.java
ashMap.java
ashSet.java
ashtable.java
dentityHashMap.java
terator.java
inkedHashMap.java
inkedHashSet.java
inkedList.java
ist.java
istIterator.java
riorityQueue.java
roperties.java
andomAccess.java
et.java
ortedMap.java
ortedSet.java
reeMap.java
reeSet.java
ector.java
eakHashMap.java
ar/Attributes.java
ar/Manifest.java
ar/Pack200.java
ar/package.html
ogging/package.html
ackage.html
pi/LocaleServiceProvider.java
de81def7a777e4423771ee15b49bedd05c7fdbf5 11-May-2016 Narayan Kamath <narayan@google.com> JarFile: Optimize getMetaInfEntryNames.

Bring back the OpenJDK implementation but make sure that it's
case sensitive in its matching.

Also update JarFile benchmark to use a different set of JarFiles
(ones that actually have resources and are signed).

AFTER:

Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/framework/core-oj.jar}}
runtime(ns): min=89200.91, 1st qu.=92035.88, median=96248.38, mean=95636.11, 3rd qu.=97204.71, max=104263.73
Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/priv-app/Phonesky/Phonesky.apk}}
runtime(ns): min=32815012.40, 1st qu.=33074432.68, median=34521206.63, mean=34974008.88, 3rd qu.=36545497.61, max=39179367.36

BEFORE:
Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/framework/core-oj.jar}}
runtime(ns): min=317222.97, 1st qu.=333416.42, median=339164.45, mean=344867.65, 3rd qu.=352596.11, max=392011.29
Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/priv-app/Phonesky/Phonesky.apk}}
runtime(ns): min=36966924.00, 1st qu.=39058659.29, median=43041285.43, mean=42476010.68, 3rd qu.=45566839.83, max=46848927.18

This isn't a perfect benchmark, because a lot of time is spent constructing the JarFile each time.
However, we've shaved times by a third for files with a "reasonable"
number of entries.

bug: 28713954

(cherry picked from commit ff96d13467fa65856c19aaf06b151ce60e0edd8f)

Change-Id: I7d26fe9ce17af0f3ed9f8a5aab21dca9c76febb8
ar/JarFile.java
45908408e773e57f09677ab5a84fd3733e156f95 11-May-2016 Narayan Kamath <narayan@google.com> JarFile: change manifest from a soft to a strong reference.

While we're here, also get rid of unused methods and change
markers.

bug: 28692091
Change-Id: Iced30cbe36af980486e6bc304d18411ffab28cf0
ar/JarFile.java
ff96d13467fa65856c19aaf06b151ce60e0edd8f 11-May-2016 Narayan Kamath <narayan@google.com> JarFile: Optimize getMetaInfEntryNames.

Bring back the OpenJDK implementation but make sure that it's
case sensitive in its matching.

Also update JarFile benchmark to use a different set of JarFiles
(ones that actually have resources and are signed).

AFTER:

Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/framework/core-oj.jar}}
runtime(ns): min=89200.91, 1st qu.=92035.88, median=96248.38, mean=95636.11, 3rd qu.=97204.71, max=104263.73
Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/priv-app/Phonesky/Phonesky.apk}}
runtime(ns): min=32815012.40, 1st qu.=33074432.68, median=34521206.63, mean=34974008.88, 3rd qu.=36545497.61, max=39179367.36

BEFORE:
Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/framework/core-oj.jar}}
runtime(ns): min=317222.97, 1st qu.=333416.42, median=339164.45, mean=344867.65, 3rd qu.=352596.11, max=392011.29
Experiment {instrument=runtime, benchmarkMethod=time, vm=default, parameters={filename=/system/priv-app/Phonesky/Phonesky.apk}}
runtime(ns): min=36966924.00, 1st qu.=39058659.29, median=43041285.43, mean=42476010.68, 3rd qu.=45566839.83, max=46848927.18

This isn't a perfect benchmark, because a lot of time is spent constructing the JarFile each time.
However, we've shaved times by a third for files with a "reasonable"
number of entries.

bug: 28713954

Change-Id: Ic0de000be683dc8009818930658ae4a443d81559
ar/JarFile.java
17d9d335a92b93da440e19d07c935c5f9e9e16fc 03-May-2016 Richard Uhler <ruhler@google.com> Hold a ClassLoader reference in NativeAllocationRegistry.

So that the native library isn't unloaded before we have a chance to
call the freeFunction.

Bug: 28406866

(cherry picked from commit 111fdf10801861427f59e42c34c40d5df484053b)

Change-Id: I80c15400335edfc31de0bb6e06ed514ac4ea1d4d
egex/Matcher.java
egex/Pattern.java
6ec20e097e68cc07fa11d93224a3d2cda9f7de93 09-May-2016 Richard Uhler <ruhler@google.com> Merge "Hold a ClassLoader reference in NativeAllocationRegistry." into nyc-dev
111fdf10801861427f59e42c34c40d5df484053b 03-May-2016 Richard Uhler <ruhler@google.com> Hold a ClassLoader reference in NativeAllocationRegistry.

So that the native library isn't unloaded before we have a chance to
call the freeFunction.

Bug: 28406866
Change-Id: I1c876b90837902ac3e65a41eb4a4fdd4f84a9b6c
egex/Matcher.java
egex/Pattern.java
d66fb8e8bb26b1d294a7c42d740acaf427a3a0a3 03-May-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Move clinit code to registration funtions

Moved clinit code that fetches field/method ids
to JNI registration funcitons. This will allow to
compile-time initialize these classes.

More classes will follow.

Bug: 28153851
Change-Id: I5918e281a65a2ca2168dfe1bdd18cc3c5df8f2f6
(cherry picked from commit 2798490baa8ee586e38bdd09707f4fb18ef0d023)
ip/Deflater.java
ip/Inflater.java
ip/ZipFile.java
2798490baa8ee586e38bdd09707f4fb18ef0d023 03-May-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Move clinit code to registration funtions

Moved clinit code that fetches field/method ids
to JNI registration funcitons. This will allow to
compile-time initialize these classes.

More classes will follow.

Bug: 28153851
Change-Id: I5918e281a65a2ca2168dfe1bdd18cc3c5df8f2f6
ip/Deflater.java
ip/Inflater.java
ip/ZipFile.java
f561c1802b6022000044af7c376894baacc0205c 02-May-2016 Igor Murashkin <iam@google.com> Merge "ojtests: Split out public/boot tests and add device targets"
7808a25deed6116009ed93a0eda87ea8ba52d133 29-Apr-2016 Andreas Gampe <agampe@google.com> Libcore: Add preload holder to TimeZone

Put CUSTOM_ZONE_ID_PATTERN into a preload holder so that TimeZone
can be compile-time initialized.

Allows to compile-time initialize:
* java.util.SimpleTimeZone
* java.util.TimeZone
* libcore.util.ZoneInfo

Bug: 27265238

(cherry picked from commit bd358d1acfa039631a4adfb7793ba62afa4db1ac)

Change-Id: Ie00f9c7ed9d4863fc0ab752213be0b6700ce7df1
imeZone.java
d76135101bc35789b351d4a7139f325117a29863 29-Apr-2016 Sergio Giro <sgiro@google.com> Merge "JarFile: make getManifestFromReference and getManEntry synchronized"
592f49a571c5d093dd91c647f9df80a0dd527cae 13-Apr-2016 Sergio Giro <sgiro@google.com> JarFile: make getManifestFromReference and getManEntry synchronized

So that all modifications to the cached manifest entry and to the
underlying JarVerifier are synchronized.

computedHasClassPathAttribute and hasClassPathAttribute are just cached
booleans that don't change once set, unsynchronized access to them would
cause only for them to be computed twice in the worst case.

Also, removed dead code and corresponding test.

Bug: 27826114
Change-Id: Id3a9b74997cb462c625861c0284196f74dcb8e9a
(cherry picked from commit f71c7ea18fdeae6d70009209653ac8626b419292)
ar/JarFile.java
c36b57476e89590c04c9c487fd304b0bee2619cf 29-Apr-2016 Sergio Giro <sgiro@google.com> Merge "JarFile: make getManifestFromReference and getManEntry synchronized" into nyc-dev
bd358d1acfa039631a4adfb7793ba62afa4db1ac 29-Apr-2016 Andreas Gampe <agampe@google.com> Libcore: Add preload holder to TimeZone

Put CUSTOM_ZONE_ID_PATTERN into a preload holder so that TimeZone
can be compile-time initialized.

Allows to compile-time initialize:
* java.util.SimpleTimeZone
* java.util.TimeZone
* libcore.util.ZoneInfo

Bug: 28174137
Change-Id: Ie00f9c7ed9d4863fc0ab752213be0b6700ce7df1
imeZone.java
4e9169b791022a066b94228e03f0d7ff6e2a35fc 27-Apr-2016 Igor Murashkin <iam@google.com> Merge "ojtests: Split out public/boot tests and add device targets" into nyc-dev
f71c7ea18fdeae6d70009209653ac8626b419292 13-Apr-2016 Sergio Giro <sgiro@google.com> JarFile: make getManifestFromReference and getManEntry synchronized

So that all modifications to the cached manifest entry and to the
underlying JarVerifier are synchronized.

computedHasClassPathAttribute and hasClassPathAttribute are just cached
booleans that don't change once set, unsynchronized access to them would
cause only for them to be computed twice in the worst case.

Also, removed dead code and corresponding test.

Bug: 27826114
Change-Id: Id3a9b74997cb462c625861c0284196f74dcb8e9a
ar/JarFile.java
533805c1b570b1ecaa963eb02bcd2264adbc95ca 26-Apr-2016 Narayan Kamath <narayan@google.com> ResourceBundle : Use UTF-8 for property based resources.

bug: 26879578

(cherry picked from commit d07ed5829b5449874393b365a3393596406edd31)

Change-Id: I29ee5516c4429712f49a2e1c85dc5fc5dba3a225
esourceBundle.java
289e51c2258b001f2aa6d6e67b21be7bb65d5102 04-Apr-2016 Igor Murashkin <iam@google.com> ojtests: Split out public/boot tests and add device targets

* Enable tests to be run from CTS (without changing bootclasspath)
* Fix host test script to pass higher heap maximum
* Include test source code as part of the core-ojtests-public.jar

Bug: 27521545
Bug: 27797922
Bug: 28389144
Change-Id: Ibd5ac74c939d1252e17dab2dc22d2a00de837bfe
tream/AbstractPipeline.java
tream/DistinctOps.java
tream/DoublePipeline.java
tream/IntPipeline.java
tream/LongPipeline.java
tream/Node.java
tream/PipelineHelper.java
tream/ReferencePipeline.java
tream/Sink.java
tream/SliceOps.java
tream/SpinedBuffer.java
tream/StreamOpFlag.java
tream/StreamShape.java
603700058363f21b7b2ecae9c44e9617183ab3f9 04-Apr-2016 Igor Murashkin <iam@google.com> ojtests: Split out public/boot tests and add device targets

* Enable tests to be run from CTS (without changing bootclasspath)
* Fix host test script to pass higher heap maximum
* Include test source code as part of the core-ojtests-public.jar

Bug: 27521545
Bug: 27797922
Change-Id: Ibd5ac74c939d1252e17dab2dc22d2a00de837bfd
(cherry picked from commit ce0115e08189fcb96f990f0b93a6c2aeae59250e)
tream/AbstractPipeline.java
tream/DistinctOps.java
tream/DoublePipeline.java
tream/IntPipeline.java
tream/LongPipeline.java
tream/Node.java
tream/PipelineHelper.java
tream/ReferencePipeline.java
tream/Sink.java
tream/SliceOps.java
tream/SpinedBuffer.java
tream/StreamOpFlag.java
tream/StreamShape.java
7fe12c77c9cb7c415f94d72f366f79b7699e246d 26-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Restore fastpath of Pattern#split" into nyc-dev
6238c7b3995953d394629585be4d72a524003ae7 25-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Restore fastpath of Pattern#split

Re-added lost fastpath for Pattern#split
called with single character split regex.

Removed almost identical fastpath from
String#split and made it use the one in
the Pattern class.

Before:
Trial Report (1 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=61332.97, 1st qu.=62783.21, median=63029.70, mean=63793.72, 3rd qu.=64398.73, max=69335.01
Trial Report (2 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=62285.54, 1st qu.=62801.82, median=63652.11, mean=64028.37, 3rd qu.=64508.20, max=68743.82
Trial Report (3 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=3145.06, 1st qu.=3224.04, median=3369.42, mean=3405.25, 3rd qu.=3601.02, max=3714.71
Trial Report (4 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitHard, vm=default, parameters={}}
Results:
runtime(ns): min=96497.74, 1st qu.=102259.06, median=105605.01, mean=105157.62, 3rd qu.=108752.15, max=110870.39
Trial Report (5 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=3164.36, 1st qu.=3200.15, median=3261.57, mean=3319.27, 3rd qu.=3402.46, max=3727.68
Trial Report (6 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitNewline, vm=default, parameters={}}
Results:
runtime(ns): min=3129.43, 1st qu.=3138.40, median=3161.53, mean=3197.32, 3rd qu.=3253.53, max=3359.39

After:
Trial Report (1 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=3225.99, 1st qu.=3253.19, median=3267.54, mean=3320.92, 3rd qu.=3406.82, max=3436.16
Trial Report (2 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=3277.96, 1st qu.=3295.68, median=3339.86, mean=3403.39, 3rd qu.=3539.36, max=3677.60
Trial Report (3 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=3195.46, 1st qu.=3216.71, median=3247.12, mean=3354.20, 3rd qu.=3510.25, max=3686.05
Trial Report (4 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitHard, vm=default, parameters={}}
Results:
runtime(ns): min=99889.34, 1st qu.=100793.37, median=102606.42, mean=103979.16, 3rd qu.=105644.24, max=115821.46
Trial Report (5 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=2926.79, 1st qu.=3080.29, median=3156.58, mean=3144.20, 3rd qu.=3228.23, max=3259.98
Trial Report (6 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitNewline, vm=default, parameters={}}
Results:
runtime(ns): min=3134.79, 1st qu.=3174.47, median=3221.38, mean=3250.06, 3rd qu.=3315.56, max=3492.58

Bug: 28330359
Change-Id: If302b36579cb6b6e9ce6907540e8481057455820
(cherry picked from commit b14296a6415c216acb84683a9b930f7678a5201d)
egex/Pattern.java
ac8051d6632fe2e0d2c50b0d519e21fa7030f2a0 26-Apr-2016 Narayan Kamath <narayan@google.com> ResourceBundle : Use UTF-8 for property based resources.

bug: 26879578
Change-Id: I9745f8e8846dfe11ed4bfdf1960f08f1b76e9005
esourceBundle.java
c3d875180189cdb59ff48a3dc7cd4b8bf1efcea4 26-Apr-2016 Narayan Kamath <narayan@google.com> Revert "ojtests: Split out public/boot tests and add device targets"

This reverts commit ce0115e08189fcb96f990f0b93a6c2aeae59250e.

This topic has been reverted because it causes build flakiness and
bogus verification failures on most active changes.

Change-Id: I7dfa25e54c0121b4059f25a8f42f3e0532c1d4c0
tream/AbstractPipeline.java
tream/DistinctOps.java
tream/DoublePipeline.java
tream/IntPipeline.java
tream/LongPipeline.java
tream/Node.java
tream/PipelineHelper.java
tream/ReferencePipeline.java
tream/Sink.java
tream/SliceOps.java
tream/SpinedBuffer.java
tream/StreamOpFlag.java
tream/StreamShape.java
8e579d79cea9a38291c750717950a9f22997a098 26-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Restore fastpath of Pattern#split"
9d6a3f9c81646636d51e3df641476fc30bd6d09b 26-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "TimSort fails with ArrayIndexOutOfBoundsException"
bdd8f3902d70d45613743c881528236059177b88 26-Apr-2016 Tobias Thierer <tobiast@google.com> Merge "Avoid additional Object allocations that are immediately unboxed"
ce0115e08189fcb96f990f0b93a6c2aeae59250e 04-Apr-2016 Igor Murashkin <iam@google.com> ojtests: Split out public/boot tests and add device targets

* Enable tests to be run from CTS (without changing bootclasspath)
* Fix host test script to pass higher heap maximum
* Include test source code as part of the core-ojtests-public.jar

Bug: 27521545
Bug: 27797922
Change-Id: Ibd5ac74c939d1252e17dab2dc22d2a00de837bfd
tream/AbstractPipeline.java
tream/DistinctOps.java
tream/DoublePipeline.java
tream/IntPipeline.java
tream/LongPipeline.java
tream/Node.java
tream/PipelineHelper.java
tream/ReferencePipeline.java
tream/Sink.java
tream/SliceOps.java
tream/SpinedBuffer.java
tream/StreamOpFlag.java
tream/StreamShape.java
a5448c0d798644d549426f037ebc6676b1f4de3e 21-Apr-2016 Tobias Thierer <tobiast@google.com> Avoid additional Object allocations that are immediately unboxed

This should catch most of the remaining cases in libcore, although
I was more hesitant in tests; for example, TreeMapExtendTest does
a lot of unnecessary boxing but the benefit of optimising the test
doesn't seem worth the risk of potentially introducing bugs.

Bug: 28289401
Change-Id: I911d2b5cf130f974427b4fe7e1916f1632e5f4fa
ogging/Logger.java
742e6e3264e81f7ebabb5f3b551c47e3778a2fc7 19-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> TimSort fails with ArrayIndexOutOfBoundsException

... on worst case long arrays

cherry-picked from jdk8

HG changeset patch:
Reviewed-by: rriggs, dholmes
author lpriima
date Thu, 12 Feb 2015 10:34:35 -0500 (14 months ago)
parents 6a07646242ae
8072909: TimSort fails with ArrayIndexOutOfBoundsException on worst
case long arrays

The change increases stack size to handle arrays up to length
Integer.MAX_VALUE-4, if array is filled by the worst case stack size
increasing scenario.

The Exception couldn't be reproduced on Android as arrays can't be
created sufficiently large to cause the error.

A paper was submitted to CAV'15 and has now been accepted. It can be
found here - http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf

Change-Id: I6dce949cfa8e869a3e140dc9c4bf58a59c456e97
omparableTimSort.java
imSort.java
b14296a6415c216acb84683a9b930f7678a5201d 25-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Restore fastpath of Pattern#split

Re-added lost fastpath for Pattern#split
called with single character split regex.

Removed almost identical fastpath from
String#split and made it use the one in
the Pattern class.

Before:
Trial Report (1 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=61332.97, 1st qu.=62783.21, median=63029.70, mean=63793.72, 3rd qu.=64398.73, max=69335.01
Trial Report (2 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=62285.54, 1st qu.=62801.82, median=63652.11, mean=64028.37, 3rd qu.=64508.20, max=68743.82
Trial Report (3 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=3145.06, 1st qu.=3224.04, median=3369.42, mean=3405.25, 3rd qu.=3601.02, max=3714.71
Trial Report (4 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitHard, vm=default, parameters={}}
Results:
runtime(ns): min=96497.74, 1st qu.=102259.06, median=105605.01, mean=105157.62, 3rd qu.=108752.15, max=110870.39
Trial Report (5 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=3164.36, 1st qu.=3200.15, median=3261.57, mean=3319.27, 3rd qu.=3402.46, max=3727.68
Trial Report (6 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitNewline, vm=default, parameters={}}
Results:
runtime(ns): min=3129.43, 1st qu.=3138.40, median=3161.53, mean=3197.32, 3rd qu.=3253.53, max=3359.39

After:
Trial Report (1 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=3225.99, 1st qu.=3253.19, median=3267.54, mean=3320.92, 3rd qu.=3406.82, max=3436.16
Trial Report (2 of 6):
Experiment {instrument=runtime, benchmarkMethod=timePatternSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=3277.96, 1st qu.=3295.68, median=3339.86, mean=3403.39, 3rd qu.=3539.36, max=3677.60
Trial Report (3 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitComma, vm=default, parameters={}}
Results:
runtime(ns): min=3195.46, 1st qu.=3216.71, median=3247.12, mean=3354.20, 3rd qu.=3510.25, max=3686.05
Trial Report (4 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitHard, vm=default, parameters={}}
Results:
runtime(ns): min=99889.34, 1st qu.=100793.37, median=102606.42, mean=103979.16, 3rd qu.=105644.24, max=115821.46
Trial Report (5 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitLiteralDot, vm=default, parameters={}}
Results:
runtime(ns): min=2926.79, 1st qu.=3080.29, median=3156.58, mean=3144.20, 3rd qu.=3228.23, max=3259.98
Trial Report (6 of 6):
Experiment {instrument=runtime, benchmarkMethod=timeStringSplitNewline, vm=default, parameters={}}
Results:
runtime(ns): min=3134.79, 1st qu.=3174.47, median=3221.38, mean=3250.06, 3rd qu.=3315.56, max=3492.58

Bug: 28330359
Change-Id: If302b36579cb6b6e9ce6907540e8481057455820
egex/Pattern.java
b93d69d2194df2cdf217c02c56fd388511142241 25-Apr-2016 Hans Boehm <hboehm@google.com> Merge "Convert Pattern and Matcher to use NativeAllocationRegistry" into nyc-dev
df105be9e62a220e0c3d888913a92e329e10605a 20-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Patch differences in classes taken from older OpenJDK version

Few of the classes were found to have taken from OpenJDK b132,
and OpenJDK 8u60 includes few fixes to those classes. Some of the
changes were ignored which included change in sort methods for List and
Collections due to the behavioral changes.

Bug: 28239805
(cherry-picked from commit c5b84fc0e3e3864d63717824a3195d04496d59fb)
Change-Id: I20841bbd53e22e4f0a6b786df21d30d96ba102ab
ollections.java
pliterators.java
66e10c8590aa9107d09d2f16f64718e2261145a4 25-Apr-2016 Neil Fuller <nfuller@google.com> Merge "Add missed overrides for OpenJDK 8 Map default methods"
5b53b8c56fb2aba6fffc5c467d092d9dcaf45f34 22-Apr-2016 Hans Boehm <hboehm@google.com> Convert Pattern and Matcher to use NativeAllocationRegistry

Avoid finalizer use, since already finalized objects may still
be accessed by other finalizers, causing native memory
corruption.

This should also improve memory tracking and deallocation
performance a bit.

Bug: 27887091
Change-Id: Ib1df6bcdacaf8eba622b67c10ac9ceb675067884
(cherry picked from commit d9e764ece41000c87d12d82a50eab6444ba02a8e)
egex/Matcher.java
egex/Pattern.java
2129234d12804d3fb9eb82f45ccbbc1c34b8240e 23-Apr-2016 Hans Boehm <hboehm@google.com> Merge "Convert Pattern and Matcher to use NativeAllocationRegistry"
d9e764ece41000c87d12d82a50eab6444ba02a8e 22-Apr-2016 Hans Boehm <hboehm@google.com> Convert Pattern and Matcher to use NativeAllocationRegistry

Avoid finalizer use, since already finalized objects may still
be accessed by other finalizers, causing native memory
corruption.

This should also improve memory tracking and deallocation
performance a bit.

Bug: 27887091
Change-Id: Ib1df6bcdacaf8eba622b67c10ac9ceb675067884
egex/Matcher.java
egex/Pattern.java
1f01b0e27882d669217e3acf9d429ea9afbac47e 20-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Add missed overrides for OpenJDK 8 Map default methods

Both the replace methods in TreeMap were left intentionally in the
commit 0e83756c4295f4df3853047205d94fe845573522 as there were no
behavioral differences and the default implementation was considered
sufficient. However, the upstream version is more efficient so that is
being added here.

As of now, all the overrides for the Map default implementation have
been put from the upstream, except for Hashtable and HashMap. Both
of these classes are quite different from their OpenJDK 8 versions to
accommodate the overrides. HashMap depends on the default implementation
for the following methods:

#getOrDefault
#replace(K, V)
#computeIfAbsent
#computeIfPresent
#compute
#merge

#replace(K, V, V) was reimplemented due to the behavioral differences
with the default implementation.

The following Hashtable methods are also dependent on the map default
implementation, though, they have added synchronization.

#getOrDefault
#putIfAbsent
#remove
#replace(K, V, V)
#replace(K, V)
#computeIfAbsent
#computeIfPresent
#compute

Once the classes get ready with the new changes comes with OpenJDK 8,
the above methods would be put in.

Bug: 27426743
Change-Id: Iee4fb156eddee17187386bbfffc8517415030a94
(cherry picked from commit f0d9b8aea94c2a207b7b71faaa7a8a2f78ddf1ea)
ollections.java
dentityHashMap.java
reeMap.java
c5b84fc0e3e3864d63717824a3195d04496d59fb 20-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Patch differences in classes taken from older OpenJDK version

Few of the classes were found to have taken from OpenJDK b132,
and OpenJDK 8u60 includes few fixes to those classes. Some of the
changes were ignored which included change in sort methods for List and
Collections due to the behavioral changes.

Bug: 28239805

Change-Id: I20841bbd53e22e4f0a6b786df21d30d96ba102ab
ollections.java
pliterators.java
f0d9b8aea94c2a207b7b71faaa7a8a2f78ddf1ea 20-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Add missed overrides for OpenJDK 8 Map default methods

Both the replace methods in TreeMap were left intentionally in the
commit 0e83756c4295f4df3853047205d94fe845573522 as there were no
behavioral differences and the default implementation was considered
sufficient. However, the upstream version is more efficient so that is
being added here.

As of now, all the overrides for the Map default implementation have
been put from the upstream, except for Hashtable and HashMap. Both
of these classes are quite different from their OpenJDK 8 versions to
accommodate the overrides. HashMap depends on the default implementation
for the following methods:

#getOrDefault
#replace(K, V)
#computeIfAbsent
#computeIfPresent
#compute
#merge

#replace(K, V, V) was reimplemented due to the behavioral differences
with the default implementation.

The following Hashtable methods are also dependent on the map default
implementation, though, they have added synchronization.

#getOrDefault
#putIfAbsent
#remove
#replace(K, V, V)
#replace(K, V)
#computeIfAbsent
#computeIfPresent
#compute

Once the classes get ready with the new changes comes with OpenJDK 8,
the above methods would be put in.

Bug: 27426743
Change-Id: Iee4fb156eddee17187386bbfffc8517415030a94
ollections.java
dentityHashMap.java
reeMap.java
6d66808fe4d962ccb17e4ff34e266553edf5a7cd 08-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix & restore javadoc in java.util.Locale

Restored lost information about ICU data versions
in various android releases. Also, I did discover that
<a .../> is parsed as <a ..> by browser (and not <a ...></a>
like authors expected), I did fix the link tags in Locale
& ResourceBundle.

Bug: 27441320
Change-Id: Id194a34adf01891904c8b56c711b51175f999a2c
(cherry picked from commit 91853880521647d935f1ce1717df987ff6486f2f)
ocale.java
esourceBundle.java
585c1dbaa3aeced60da4995312edcce1dbf93d62 19-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Fix & restore javadoc in java.util.Locale" into nyc-dev
6d562f688e350ade3c025bfb1c4c8cca9b3e2030 13-Apr-2016 Narayan Kamath <narayan@google.com> HashMap: Remove support for alt-hashing.

This approach has been abandoned in OpenJdk8 (in favour of tree-ifying
when the number of collisions for a given key is large). Given that :

(1) Alt-hashing has always been disabled on Android (the threshold
was Integer.MAX_VALUE).
(2) The OpenJdk8 changes are fairly extensive.

We revert to what's essentially the Android M implementation of HashMap;
always using a secondary hash, always ignoring the load factor and starting
with an initial size of 4.

The Hashtable implementation has been left untouched, except for the
removal of effectively dead alt-hashing code.

bug: 28082128

(cherry picked from commit bfada6f78af63fd626be6991c696cb0393289686)

Change-Id: Id0378441104659d341ffaf0b0edf42c592586fae
ashMap.java
ashtable.java
inkedHashMap.java
eakHashMap.java
bfada6f78af63fd626be6991c696cb0393289686 13-Apr-2016 Narayan Kamath <narayan@google.com> HashMap: Remove support for alt-hashing.

This approach has been abandoned in OpenJdk8 (in favour of tree-ifying
when the number of collisions for a given key is large). Given that :

(1) Alt-hashing has always been disabled on Android (the threshold
was Integer.MAX_VALUE).
(2) The OpenJdk8 changes are fairly extensive.

We revert to what's essentially the Android M implementation of HashMap;
always using a secondary hash, always ignoring the load factor and starting
with an initial size of 4.

The Hashtable implementation has been left untouched, except for the
removal of effectively dead alt-hashing code.

bug: 28082128

Change-Id: I12d225d9dbf52e6941864093eefdfb2d60989364
ashMap.java
ashtable.java
inkedHashMap.java
eakHashMap.java
0976dc2e109a3ca2bd977d18eee74e4b7c9ada30 04-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Add Map::replaceAll method

and corresponding unit test.

Bug: 27426743

(cherry-picked from commit 135ea6cd4f7ebe2f225351a1928d8a62bce5cb00)

Change-Id: Ia86b769fbf5ce55379325ae575d4b3818cb6ccc1
ashMap.java
ashtable.java
inkedHashMap.java
reeMap.java
eakHashMap.java
4adf3320be7004bde3a7756058acdbeca8637d1c 08-Apr-2016 Yi Kong <yikong@google.com> Port a number of OpenJDK8 stream methods

Ports the following methods with tests:
java.io.BufferedReader#lines
java.util.BitSet#stream
java.util.Random#doubles
java.util.Random#ints
java.util.Random#longs
java.util.regex.Pattern#asPredicate
java.util.regex.Pattern#splitAsStream

Bug: 28108421
Change-Id: I4813221c69c207ba42ae306d231f3f7c807abbc6
(cherry picked from commit 2c4230d24a2349039b4d7d513d0fb61542bc4cb7)
itSet.java
andom.java
egex/Pattern.java
ed7be26086ff16b6a9d665650a3529d9488c8954 12-Apr-2016 Yi Kong <yikong@google.com> Merge "Port a number of OpenJDK8 stream methods"
fcfa4fec901445f4da19d9352d4433a7cbeed5f5 11-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove timer sync thread from FileSystemPreferences

Bug: 28087967

(cherry picked from commit 9c6eef8cd47afe55cb4e8d1c096922aeb9003603)

Change-Id: Id0352c19c2da353320cfcb7462b10436356a2052
refs/FileSystemPreferences.java
9c6eef8cd47afe55cb4e8d1c096922aeb9003603 11-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove timer sync thread from FileSystemPreferences

Bug: 28087967
Change-Id: I2856481b066a18e221002e8b9ed1c063b0dbfd63
refs/FileSystemPreferences.java
2c4230d24a2349039b4d7d513d0fb61542bc4cb7 08-Apr-2016 Yi Kong <yikong@google.com> Port a number of OpenJDK8 stream methods

Ports the following methods with tests:
java.io.BufferedReader#lines
java.util.BitSet#stream
java.util.Random#doubles
java.util.Random#ints
java.util.Random#longs
java.util.regex.Pattern#asPredicate
java.util.regex.Pattern#splitAsStream

Bug: 28108421
Change-Id: I4813221c69c207ba42ae306d231f3f7c807abbc6
itSet.java
andom.java
egex/Pattern.java
64e9fa1a6d986fab1d2d3353ce727778a8dcc38a 12-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Add Map::replaceAll method" into nyc-dev
404b64a5388f2811182e3180d8cd5a1a473a08b0 07-Apr-2016 Yi Kong <yikong@google.com> Make links to Oracle Java tech docs absolute

Bug: 27540501
Change-Id: Id8c1e5ae7fcc52e0a03bee9c76a44bb2c3378031
roperties.java
ar/Attributes.java
ar/Manifest.java
ar/package.html
ogging/package.html
ackage.html
pi/LocaleServiceProvider.java
fdf68926167b1f48d16513f26ad885ef16b7c34d 11-Apr-2016 Yi Kong <yikong@google.com> Merge "Make links to Oracle Java tech docs absolute"
91853880521647d935f1ce1717df987ff6486f2f 08-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix & restore javadoc in java.util.Locale

Restored lost information about ICU data versions
in various android releases. Also, I did discover that
<a .../> is parsed as <a ..> by browser (and not <a ...></a>
like authors expected), I did fix the link tags in Locale
& ResourceBundle.

Bug: 27441320
Change-Id: Id194a34adf01891904c8b56c711b51175f999a2c
ocale.java
esourceBundle.java
1eae5d5c81785d589e337d408f2f3b87fdbb4c8e 06-Apr-2016 Yi Kong <yikong@google.com> Port OpenJDK8 java.util.Arrays#parallelPrefix method

Bug: 28058863
Change-Id: I274d25c0c9e5639a03f694214d625b2f0cf0f7ec
(cherry picked from commit c5c1e2717349a96913dc88722a20c7c1ec2cae68)
rrays.java
623cc20acf1b12aad7abeb86aa67ec791de48751 07-Apr-2016 Yi Kong <yikong@google.com> Merge "Port OpenJDK8 java.util.Arrays#parallelPrefix method"
0967e6020a0e3ccfd88679178cf0b3056863a96c 07-Apr-2016 Yi Kong <yikong@google.com> Make links to Oracle Java tech docs absolute

Bug: 27540501
Change-Id: Id8c1e5ae7fcc52e0a03bee9c76a44bb2c3378031
roperties.java
ar/Attributes.java
ar/Manifest.java
ar/package.html
ogging/package.html
ackage.html
pi/LocaleServiceProvider.java
c5c1e2717349a96913dc88722a20c7c1ec2cae68 06-Apr-2016 Yi Kong <yikong@google.com> Port OpenJDK8 java.util.Arrays#parallelPrefix method

Bug: 28058863
Change-Id: I274d25c0c9e5639a03f694214d625b2f0cf0f7ec
rrays.java
3a61a2c321c974c930fe55a47cb3300a8a1255f5 07-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Fix LongStream#range for range > Long.MAX_VALUE"
9e213e5fd2a1a3ce5cd6078e3c88b9a4f5353b91 05-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix LongStream#range for range > Long.MAX_VALUE

Updated LongStream#range split point calculation to use BigInteger, this
fixes range calculation for range > Long.MAX_VALUE and fixes
OJ stream testLongLongRange[Closed]

Bug: 28000164
Change-Id: Ib48ad86ae867ca886e95b39afc3c4905756982c3
(cherry picked from commit 32e55399571b9a18a3996a7ad330f6dd7cf92417)
tream/LongStream.java
29b21ff427dbd7c0dac8ce0b43df481d8dc0ffae 07-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Fix LongStream#range for range > Long.MAX_VALUE" into nyc-dev
32e55399571b9a18a3996a7ad330f6dd7cf92417 05-Apr-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix LongStream#range for range > Long.MAX_VALUE

Updated LongStream#range split point calculation to use BigInteger, this
fixes range calculation for range > Long.MAX_VALUE and fixes
OJ stream testLongLongRange[Closed]

Bug: 28000164
Change-Id: Ib48ad86ae867ca886e95b39afc3c4905756982c3
tream/LongStream.java
59df7aa975c970bd26131289d46d3acd26e3edb8 04-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Add Arrays$ArrayList::replaceAll

and corresponding test.

Bug: 27540008

(cherry-picked from commit 2c5ded18d09c06540892bfee5d20b69038029f8a)

Change-Id: Ib755e5f183fc05d03b1696c3c660d8508fe719f6
rrays.java
01e8682d6bc9803354f976e7a2ded91be0f42085 06-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Add Arrays$ArrayList::replaceAll" into nyc-dev
135ea6cd4f7ebe2f225351a1928d8a62bce5cb00 04-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Add Map::replaceAll method

and corresponding unit test.

Bug: 27426743
Change-Id: Ia86b769fbf5ce55379325ae575d4b3818cb6ccc1
ashMap.java
ashtable.java
inkedHashMap.java
reeMap.java
eakHashMap.java
9c4d5752a75ab0f1fa37aac2984629bf30cafa94 01-Apr-2016 Joachim Sauer <jsauer@google.com> Change LinkedHashMap#removeEldestEntry behaviour.

The move to OpenJDK changed the behaviour of the removeEldestEntry
method in a way that is incompatible with earlier Android versions.
While that behaviour was never documented, we try to be compatible for
now. Future Android releases will probably revert to behaviour that's
closer to the RI.

This is attempt #2. The behaviour of of the previous implementation was
even stranger then expected. removeEldestEntry() was called between
incrementing the size field and actually adding the entry. So any code
that inspected the map during the removeEldestEntry() call would see
a size that's 1 bigger than the actual elements (and the newly added
element would not be in the map yet).

The code to reproduce this in the OpenJDK based implementation is less
than elegant and should be removed for future releases.

Bug: 27929722
(cherry picked from commit 7a0fb3b1203df27e0bb3e5b1ee3346851f9af38d)

Change-Id: If4351b9979ba744d5c6556c73c1e23077b369b1b
inkedHashMap.java
2c5ded18d09c06540892bfee5d20b69038029f8a 04-Apr-2016 Shubham Ajmera <shubhamajmera@google.com> Add Arrays$ArrayList::replaceAll

and corresponding test.

Bug: 27540008
Change-Id: Ib755e5f183fc05d03b1696c3c660d8508fe719f6
rrays.java
7a0fb3b1203df27e0bb3e5b1ee3346851f9af38d 01-Apr-2016 Joachim Sauer <jsauer@google.com> Change LinkedHashMap#removeEldestEntry behaviour.

The move to OpenJDK changed the behaviour of the removeEldestEntry
method in a way that is incompatible with earlier Android versions.
While that behaviour was never documented, we try to be compatible for
now. Future Android releases will probably revert to behaviour that's
closer to the RI.

This is attempt #2. The behaviour of of the previous implementation was
even stranger then expected. removeEldestEntry() was called between
incrementing the size field and actually adding the entry. So any code
that inspected the map during the removeEldestEntry() call would see
a size that's 1 bigger than the actual elements (and the newly added
element would not be in the map yet).

The code to reproduce this in the OpenJDK based implementation is less
than elegant and should be removed for future releases.

Bug: 27929722
Change-Id: If6bf7fe7f7b2caa655e25b11f18b552c3b4844e4
inkedHashMap.java
aad2abaafbc03c7750d7e65f187dcefb4bbcc090 01-Apr-2016 Narayan Kamath <narayan@google.com> Revert "Change LinkedHashMap#removeEldestEntry behaviour."

This reverts commit fca5aaa0a2c31d322b708012df2158d8399cefe3.

Breaks org.apache.harmony.tests.java.util.LinkedHashMapTest#test_remove_eldest.

bug: 27929722

(cherry picked from commit 90932be12a5e012347549ad293d15015eb2410a9)

Change-Id: Id5b910e90fb08f4902215ad86e6dae16dc82dbb6
inkedHashMap.java
90932be12a5e012347549ad293d15015eb2410a9 01-Apr-2016 Narayan Kamath <narayan@google.com> Revert "Change LinkedHashMap#removeEldestEntry behaviour."

This reverts commit fca5aaa0a2c31d322b708012df2158d8399cefe3.

Breaks org.apache.harmony.tests.java.util.LinkedHashMapTest#test_remove_eldest.

Change-Id: I8b71e40f2d6c7e936a6d604d0326c2312cbb9459
bug: 27929722
inkedHashMap.java
452d7ae56a3d07eab0a422f68f0a391633931df8 01-Apr-2016 Joachim Sauer <jsauer@google.com> Change LinkedHashMap#removeEldestEntry behaviour.

The move to OpenJDK changed the behaviour of the removeEldestEntry
method in a way that is incompatible with earlier Android versions.
While that behaviour was never documented, we try to be compatible for
now. Future Android releases will probably revert to behaviour that's
closer to the RI.

Bug: 27929722
(cherry picked from commit fca5aaa0a2c31d322b708012df2158d8399cefe3)

Change-Id: I3151428cb9444212b40749d4f425f25e521a29c6
inkedHashMap.java
fca5aaa0a2c31d322b708012df2158d8399cefe3 01-Apr-2016 Joachim Sauer <jsauer@google.com> Change LinkedHashMap#removeEldestEntry behaviour.

The move to OpenJDK changed the behaviour of the removeEldestEntry
method in a way that is incompatible with earlier Android versions.
While that behaviour was never documented, we try to be compatible for
now. Future Android releases will probably revert to behaviour that's
closer to the RI.

Bug: 27929722
Change-Id: I8569ade68fe0abbd712b3e3551fc95a26e09ffd9
inkedHashMap.java
340f1153f4adf2a7ee423d8226eaab1b2fe5aae5 31-Mar-2016 Yi Kong <yikong@google.com> Merge "Clean up legacy security code" into nyc-dev
eb385c8957bc6feddb50c6c2f437b16f8dedc70c 31-Mar-2016 Joachim Sauer <jsauer@google.com> Ensure %E and %e use upper- and lower-case E.

Formatter is documented to use e and E as the exponent symbol when using
%e and %E respectively.

Android adds internationalization support to this, but we still want to
stay consistent in the ROOT locale.

Bug: 27566754
(cherry picked from commit 52a8233bea1b27b348cde146a2af446064e0dd34)

Change-Id: I12543b3e84b966cdda58053f0bc45e18baef02fe
ormatter.java
52b7f6521232e255f4864305b5ded5f0ed93acfa 31-Mar-2016 Yi Kong <yikong@google.com> Clean up legacy security code

The following legacy security classes are stubbed and their Javadoc removed.

java.io.FilePermission
java.io.SerializablePermission
java.lang.RuntimePermission
java.lang.reflect.ReflectPermission
java.net.NetPermission
java.net.SocketPermission
java.security.AllPermission
java.security.AuthProvider
java.security.BasicPermission
java.security.CodeSource
java.security.DomainCombiner
java.security.Permission
java.security.PermissionCollection
java.security.Permissions
java.security.PrivilegedAction
java.security.PrivilegedActionException
java.security.PrivilegedExceptionAction
java.security.ProtectionDomain
java.security.SecurityPermission
java.security.UnresolvedPermission
java.security.acl.Permission
java.sql.SQLPermission
java.util.PropertyPermission
java.util.logging.LoggingPermission
javax.crypto.CryptoAllPermission
javax.crypto.CryptoPermission
javax.crypto.CryptoPermissions
javax.crypto.CryptoPolicyParser
javax.crypto.JceSecurityManager
javax.net.ssl.SSLPermission
javax.security.auth.AuthPermission
javax.security.auth.PrivateCredentialPermission
javax.security.auth.SubjectDomainCombiner

Bug: 27762555
Change-Id: I2a01da447380bb5bdca4909267590239ada0858a
(cherry picked from commit 9b7cfceb7b825835730f7977d4935dec3ff1a3be)
ropertyPermission.java
ogging/LoggingPermission.java
52a8233bea1b27b348cde146a2af446064e0dd34 31-Mar-2016 Joachim Sauer <jsauer@google.com> Ensure %E and %e use upper- and lower-case E.

Formatter is documented to use e and E as the exponent symbol when using
%e and %E respectively.

Android adds internationalization support to this, but we still want to
stay consistent in the ROOT locale.

Bug: 27566754
Change-Id: I6260cb22d3000d6c77ea23610bb776ef1c817eef
ormatter.java
9b7cfceb7b825835730f7977d4935dec3ff1a3be 31-Mar-2016 Yi Kong <yikong@google.com> Clean up legacy security code

The following legacy security classes are stubbed and their Javadoc removed.

java.io.FilePermission
java.io.SerializablePermission
java.lang.RuntimePermission
java.lang.reflect.ReflectPermission
java.net.NetPermission
java.net.SocketPermission
java.security.AllPermission
java.security.AuthProvider
java.security.BasicPermission
java.security.CodeSource
java.security.DomainCombiner
java.security.Permission
java.security.PermissionCollection
java.security.Permissions
java.security.PrivilegedAction
java.security.PrivilegedActionException
java.security.PrivilegedExceptionAction
java.security.ProtectionDomain
java.security.SecurityPermission
java.security.UnresolvedPermission
java.security.acl.Permission
java.sql.SQLPermission
java.util.PropertyPermission
java.util.logging.LoggingPermission
javax.crypto.CryptoAllPermission
javax.crypto.CryptoPermission
javax.crypto.CryptoPermissions
javax.crypto.CryptoPolicyParser
javax.crypto.JceSecurityManager
javax.net.ssl.SSLPermission
javax.security.auth.AuthPermission
javax.security.auth.PrivateCredentialPermission
javax.security.auth.SubjectDomainCombiner

Bug: 27762555
Change-Id: I2a01da447380bb5bdca4909267590239ada0858a
ropertyPermission.java
ogging/LoggingPermission.java
4f549c0a2df05bf19a068fcd8a917ba332cf809a 18-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Add OpenJDK 8 java.util.List Default Methods

and corresponding tests.

Added replaceAll and sort methods from the upstream except for the
CopyOnWriteArrayList.

Added forEach method along with the above two methods in
CopyOnWriteArrayList.

Bug: 27693350
Bug: 27540008

Change-Id: Id32df836e79bee614c0dce8c61dbc7b06731265d
rrayList.java
ollections.java
ist.java
ector.java
124903b1c763b56e1ae6b5a390c5cb9bb173dc97 29-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Port OpenJDK8 changes in java.util.Map"
1f1ae1a1f49b9d2cc4a02e357f751d40660fa43b 29-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Merge changes from topics 'list_default_method', 'map_default_methods' into nyc-dev

* changes:
Add OpenJDK 8 java.util.List Default Methods
Port OpenJDK8 changes in java.util.Map
ed47d30308588e419164d9311a41b04b8eefa04c 18-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Add OpenJDK 8 java.util.List Default Methods

and corresponding tests.

Added replaceAll and sort methods from the upstream except for the
CopyOnWriteArrayList.

Added forEach method along with the above two methods in
CopyOnWriteArrayList.

Bug: 27693350
Bug: 27540008
(cherry-picked from commit 67b8c3f1414bf04e53c094b951c8ea7903998d90)
Change-Id: Id32df836e79bee614c0dce8c61dbc7b06731265d
rrayList.java
ollections.java
ist.java
ector.java
0e83756c4295f4df3853047205d94fe845573522 08-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Port OpenJDK8 changes in java.util.Map

& add tests.

The CL add tests for map default methods added in Java 8 - getOrDefault,
putIfAbsent, remove(K, V), replace(K, V, V), replace(K, V), forEach,
replaceAll, compute, computeIfAbsent, computeIfPresent, putIfAbsent,
merge.

Methods have been made synchronzed in Hashtable. They are using the
default map methods instead of taking the upstream changes.

Replace(K, V, V) in LinkedHashMap has been overridden as it doesn't
record access when the replace method doesn't make any replacement.

Bug: 27426743
(cherry-picked from commit 88f1a4f0b1efb746419672919654c285ce44fbc5)
Change-Id: Ifb2130698dd0ed42acc5c0f429496eebb444e21c
ollections.java
ashMap.java
ashtable.java
inkedHashMap.java
7d3d3d012f4362ece29ca94176fbb64555d05dd1 28-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Add OpenJDK Arrays parallelSetAll methods"
501c3a2e032cf10db12fb4641f4d3a3ebfa57a81 23-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Add OpenJDK Arrays parallelSetAll methods

Adds parallelSetAll(int[], java.util.function.IntUnaryOperator),
parallelSetAll(long[], java.util.function.IntToLongFunction),
parallelSetAll(double[], java.util.function.IntToDoubleFunction),
parallelSetAll(T[], java.util.function.IntFunction<? extends T>)
from the upstream along with the corresponding tests.

Bug: 27540010
(cherry-picked from commit 8410d73155d650a295915926dc8a0c961bb46b58)
Change-Id: I3be47b67b6888c01f4ea77c2da32b74d58d027bd
rrays.java
afb915f530aae2342fd3fd92af3446682a819d10 18-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add missing #(stream|parallelStream|spliterator) in Collections

Bug: 27692239
Bug: 27605529

(cherry-picked from commit a35b0ab4eda2135596e4194cc63f7150396d9aa9)
Change-Id: I10c20ff4a20e0ad1c2769c275de7dffaa7ba9543
ollection.java
ollections.java
44aed07672d7775f168a49dbb5b8a13682c02600 08-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Port OpenJDK8 changes in java.util.Map

& add tests.

The CL add tests for map default methods added in Java 8 - getOrDefault,
putIfAbsent, remove(K, V), replace(K, V, V), replace(K, V), forEach,
replaceAll, compute, computeIfAbsent, computeIfPresent, putIfAbsent,
merge.

Methods have been made synchronzed in Hashtable. They are using the
default map methods instead of taking the upstream changes.

Replace(K, V, V) in LinkedHashMap has been overridden as it doesn't
record access when the replace method doesn't make any replacement.

Bug: 27426743

Change-Id: Ifb2130698dd0ed42acc5c0f429496eebb444e21c
ollections.java
ashMap.java
ashtable.java
inkedHashMap.java
91bae3c5d9142b9cb2877736523bbf0c9385b209 23-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Revert "Change links to Streams packages to {@code}."

This reverts commit b4998e53d91ce1decfa7c7634d80143626cf7fa1.

As the stream package has been made public, these changes should be
reverted.

Bug: 27426738
Bug: 27692239

(cherry-picked from commit a2f3a30b4256145b4317bf4b14f6d838906d8c8f)
Change-Id: Ifadb6ba49ee23859069ab7d16863da2fd2a4dfc6
oubleSummaryStatistics.java
ntSummaryStatistics.java
ongSummaryStatistics.java
5d28755c97d9d07e48a32a85bb559fef4ae9a3c0 24-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Revert "Change links to Streams packages to {@code}.""
a2f3a30b4256145b4317bf4b14f6d838906d8c8f 23-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Revert "Change links to Streams packages to {@code}."

This reverts commit b4998e53d91ce1decfa7c7634d80143626cf7fa1.

As the stream package has been made public, these changes should be
reverted.

Bug: 27426738
Bug: 27692239
Change-Id: Ifadb6ba49ee23859069ab7d16863da2fd2a4dfc6
oubleSummaryStatistics.java
ntSummaryStatistics.java
ongSummaryStatistics.java
8410d73155d650a295915926dc8a0c961bb46b58 23-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Add OpenJDK Arrays parallelSetAll methods

Adds parallelSetAll(int[], java.util.function.IntUnaryOperator),
parallelSetAll(long[], java.util.function.IntToLongFunction),
parallelSetAll(double[], java.util.function.IntToDoubleFunction),
parallelSetAll(T[], java.util.function.IntFunction<? extends T>)
from the upstream along with the corresponding tests.

Bug: 27540010
Change-Id: I3be47b67b6888c01f4ea77c2da32b74d58d027bd
rrays.java
def94956afbfc17ea65390d16d032f9b790a5dca 18-Mar-2016 Narayan Kamath <narayan@google.com> Spliterators: pull in additional specializations.

This change also pulls in a few javadoc improvements to Collections
to make our lives easier.

bug: 27605529

(cherry picked from commit c86e0fa98d8274d7ea01213a20e3a14575406dd0)

Change-Id: I97f05ae833034f1e5a7d32329f8e19de6b97e779
rrayList.java
ollections.java
c86e0fa98d8274d7ea01213a20e3a14575406dd0 18-Mar-2016 Narayan Kamath <narayan@google.com> Spliterators: pull in additional specializations.

This change also pulls in a few javadoc improvements to Collections
to make our lives easier.

bug: 27605529

Change-Id: I3947697e18c057a864a6d13af0569b02acd64206
rrayList.java
ollections.java
b6c0097d61f5b1f40fbbf769a6565d7e44d7e8da 19-Mar-2016 Narayan Kamath <narayan@google.com> Merge "Formatter: Fix error-prone warning." into nyc-dev
6756dc8d66f79a7f912e591d44205dbcf32f7e92 18-Mar-2016 Narayan Kamath <narayan@google.com> Formatter: Fix error-prone warning.

The same fix has been applied upstream in OpenJdk8.

The only thing this fix affects is an exception error message. I am
not writing a CTS test because I don't want to give any sort of false
hope that the exception message is stable.

bug: 27680061

(cherry picked from commit 2e79d156488d81680377f015ecdd0a64dcc3b231)

Change-Id: Ie6007a3dec217ad6c23ba359a3ff2f6bbfd2d8ae
ormatter.java
ec9a3b75813f9a13d6865c5d7d22cebe2cc72bef 18-Mar-2016 Narayan Kamath <narayan@google.com> Merge "Formatter: Fix error-prone warning."
a35b0ab4eda2135596e4194cc63f7150396d9aa9 18-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add missing #(stream|parallelStream|spliterator) in Collections

Bug: 27692239
Bug: 27605529
Change-Id: I10c20ff4a20e0ad1c2769c275de7dffaa7ba9543
ollection.java
ollections.java
2e79d156488d81680377f015ecdd0a64dcc3b231 18-Mar-2016 Narayan Kamath <narayan@google.com> Formatter: Fix error-prone warning.

The same fix has been applied upstream in OpenJdk8.

The only thing this fix affects is an exception error message. I am
not writing a CTS test because I don't want to give any sort of false
hope that the exception message is stable.

bug: 27680061
Change-Id: I6281d6a96722684d1ec5fc9bf33ad6c402d125c6
ormatter.java
c0389bff2c58950f0abd2816add6c210a3d5e71b 18-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Add openJdk8 java.util.stream package" into nyc-dev
ff18b5f136f92154f2e05217e3953d10f459e561 16-Mar-2016 Igor Murashkin <iam@google.com> Add openJdk8 java.util.stream package

Based on openJdk 8u60 source & iam@ stream prototype in
ag/872080

Uncommented all code that was waiting for java.util.stream
to show up

Differences from original sources:
- Removed unsignedDivision usage from LongStream, it's not currently
supported and we don't expect that large workloads on mobile devices.
- Removed java.nio.file references.
- Removed (yet) not implemented stream-related methods from
other packages listed in package-info.java.

Bug: 27692239
Change-Id: Ie24e60e8248367b576ef91046837ccde152de373
(cherry picked from commit d0a2645e29a9b84d7e5ec822eb9904e93bd6c013)
rrayList.java
rrays.java
ollection.java
plittableRandom.java
tream/AbstractPipeline.java
tream/AbstractShortCircuitTask.java
tream/AbstractSpinedBuffer.java
tream/AbstractTask.java
tream/BaseStream.java
tream/Collector.java
tream/Collectors.java
tream/DistinctOps.java
tream/DoublePipeline.java
tream/DoubleStream.java
tream/FindOps.java
tream/ForEachOps.java
tream/IntPipeline.java
tream/IntStream.java
tream/LongPipeline.java
tream/LongStream.java
tream/MatchOps.java
tream/Node.java
tream/Nodes.java
tream/PipelineHelper.java
tream/ReduceOps.java
tream/ReferencePipeline.java
tream/Sink.java
tream/SliceOps.java
tream/SortedOps.java
tream/SpinedBuffer.java
tream/Stream.java
tream/StreamOpFlag.java
tream/StreamShape.java
tream/StreamSpliterators.java
tream/StreamSupport.java
tream/Streams.java
tream/TerminalOp.java
tream/TerminalSink.java
tream/Tripwire.java
tream/package-info.java
d0a2645e29a9b84d7e5ec822eb9904e93bd6c013 16-Mar-2016 Igor Murashkin <iam@google.com> Add openJdk8 java.util.stream package

Based on openJdk 8u60 source & iam@ stream prototype in
ag/872080

Uncommented all code that was waiting for java.util.stream
to show up

Differences from original sources:
- Removed unsignedDivision usage from LongStream, it's not currently
supported and we don't expect that large workloads on mobile devices.
- Removed java.nio.file references.
- Removed (yet) not implemented stream-related methods from
other packages listed in package-info.java.

Bug: 27692239
Change-Id: Ie24e60e8248367b576ef91046837ccde152de373
rrayList.java
rrays.java
ollection.java
plittableRandom.java
tream/AbstractPipeline.java
tream/AbstractShortCircuitTask.java
tream/AbstractSpinedBuffer.java
tream/AbstractTask.java
tream/BaseStream.java
tream/Collector.java
tream/Collectors.java
tream/DistinctOps.java
tream/DoublePipeline.java
tream/DoubleStream.java
tream/FindOps.java
tream/ForEachOps.java
tream/IntPipeline.java
tream/IntStream.java
tream/LongPipeline.java
tream/LongStream.java
tream/MatchOps.java
tream/Node.java
tream/Nodes.java
tream/PipelineHelper.java
tream/ReduceOps.java
tream/ReferencePipeline.java
tream/Sink.java
tream/SliceOps.java
tream/SortedOps.java
tream/SpinedBuffer.java
tream/Stream.java
tream/StreamOpFlag.java
tream/StreamShape.java
tream/StreamSpliterators.java
tream/StreamSupport.java
tream/Streams.java
tream/TerminalOp.java
tream/TerminalSink.java
tream/Tripwire.java
tream/package-info.java
887ab3fe607c582e10e33b3d631401d7a791aaed 17-Mar-2016 Narayan Kamath <narayan@google.com> Vector: Rework CME checks in hasNext() and next().

Port over commit b10b2a3ab693cfd6156d06ffe4e00ce69b9c9194
from java.util.ArrayList to java.util.Vector.

Also adds the same set of tests to Vector / ArrayList so
to make sure their iterators behave identically in this regard.

bug: 27430229

(cherry picked from commit 6e5b758a4438d2c154dd11a5c04d14a5d2fc907c)

Change-Id: I04cadc3eac6d591ce8b93d04a999825f65fb867a
ector.java
6e5b758a4438d2c154dd11a5c04d14a5d2fc907c 17-Mar-2016 Narayan Kamath <narayan@google.com> Vector: Rework CME checks in hasNext() and next().

Port over commit b10b2a3ab693cfd6156d06ffe4e00ce69b9c9194
from java.util.ArrayList to java.util.Vector.

Also adds the same set of tests to Vector / ArrayList so
to make sure their iterators behave identically in this regard.

bug: 27430229

Change-Id: Idd8e44737a216ac5ea9f1e6fed8892b364997292
ector.java
e1e167444be3b2d2c232f0b6f941b25f3ce4231a 11-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Port OpenJDK 8 java.util.Arrays#setAll methods

Bug: 27540010
(cherry-picked from commit 14a4ce7e537fbc11d3de7ed77a84641c0235040f)
Change-Id: I3c4224480cb17c6704845c945ef18b56ac0ca7e6
rrays.java
14a4ce7e537fbc11d3de7ed77a84641c0235040f 11-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Port OpenJDK 8 java.util.Arrays#setAll methods

Bug: 27540010
Change-Id: I3c4224480cb17c6704845c945ef18b56ac0ca7e6
rrays.java
81471d9e72be21a4f5648f8b891e7d7417508e3b 17-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Add missing Arrays::forEach method"
5c35c7ebda68cc39b6bdee20f678a150336ebd1d 14-Mar-2016 Yi Kong <yikong@google.com> Port java.util.Collection.removeIf from OpenJDK8

Source code is taken from jdk8u60.

Bug: 27538943
Change-Id: I485c024f87871e33d2f455be9807775601af77ee
(cherry picked from commit d41ca4a76ea570f9dd89a7ae56410cc75cc0a856)
rrayList.java
ollection.java
ollections.java
ector.java
5d112430b318e68acbea5b2a273c7168b8923412 15-Mar-2016 Yi Kong <yikong@google.com> Merge "Port java.util.Collection.removeIf from OpenJDK8"
471945701ad7895acf0dae73f90a5f18cd9ca23a 02-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port of oJdk8 Arrays#parallelSort* & tests

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27426684
Change-Id: I86e5b8a61201c73ab2e8bac069e540c9ca8dc120
(cherry picked from commit c9b5ffc066d5ea92fdbf0cfd7ea7f56a6e96a4ab)
rrays.java
rraysParallelSortHelpers.java
c9b5ffc066d5ea92fdbf0cfd7ea7f56a6e96a4ab 02-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port of oJdk8 Arrays#parallelSort* & tests

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27426684
Change-Id: I86e5b8a61201c73ab2e8bac069e540c9ca8dc120
rrays.java
rraysParallelSortHelpers.java
d41ca4a76ea570f9dd89a7ae56410cc75cc0a856 14-Mar-2016 Yi Kong <yikong@google.com> Port java.util.Collection.removeIf from OpenJDK8

Source code is taken from jdk8u60.

Bug: 27538943
Change-Id: I485c024f87871e33d2f455be9807775601af77ee
rrayList.java
ollection.java
ollections.java
ector.java
e8b323c7cb7d55be9a4df579231e44f04f53d766 11-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> JSR-166 update without java 1.9 method/classes

Second attempt, in frist one I've submitted some code from openJdk 1.9
that shouldn't be here, orignial change can be found at
5328e07d282bef36ac8b757bbee16a761415b2c4

Adapted from sources taken from CVS using:
cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout -D "03/03/2016 10:00:00 GMT" jsr166

This time with hidden/removed "@since 9" methods and classes

Bug: 27426599
Change-Id: Ibd8d26e13cba091bfd983c73d005e4f8d8f5946d
(cherry picked from commit b8b75116273ecfdb8ffdd1869b1c0dd04570a95e)
bstractQueue.java
rrayDeque.java
rrayPrefixHelpers.java
eque.java
ap.java
avigableMap.java
avigableSet.java
riorityQueue.java
ueue.java
plittableRandom.java
b8b75116273ecfdb8ffdd1869b1c0dd04570a95e 11-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> JSR-166 update without java 1.9 method/classes

Second attempt, in frist one I've submitted some code from openJdk 1.9
that shouldn't be here, orignial change can be found at
5328e07d282bef36ac8b757bbee16a761415b2c4

Adapted from sources taken from CVS using:
cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout -D "03/03/2016 10:00:00 GMT" jsr166

This time with hidden/removed "@since 9" methods and classes

Bug: 27426599
Change-Id: Ibd8d26e13cba091bfd983c73d005e4f8d8f5946d
bstractQueue.java
rrayDeque.java
rrayPrefixHelpers.java
eque.java
ap.java
avigableMap.java
avigableSet.java
riorityQueue.java
ueue.java
plittableRandom.java
ed4f365789d43b1961657195df223a19bf4ef20f 15-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Revert "JSR-166 update"

I missed comments on framework/base change regarding "@since 9" parts
This reverts commit 5328e07d282bef36ac8b757bbee16a761415b2c4.

Change-Id: Iff71b8a17e79a0a5c1ecadc05bccadceabb83393
bstractQueue.java
rrayDeque.java
rrayPrefixHelpers.java
eque.java
ap.java
avigableMap.java
avigableSet.java
riorityQueue.java
ueue.java
plittableRandom.java
2cab245e810ea36e84a572a06540cc2c9d3bacb3 14-Mar-2016 Yi Kong <yikong@google.com> Add missing Arrays::forEach method

Original commit c3a9db83a352d92d5a6e0098f22bde07e34a1d3b.

Bug: 27605760
Change-Id: I715d1c9b39723e8c3c5e9f8274fcf24fb80c5e4b
rrays.java
5328e07d282bef36ac8b757bbee16a761415b2c4 11-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> JSR-166 update

Adapted from sources taken from CVS using:
cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout -D "03/03/2016 10:00:00 GMT" jsr166

Bug: 27426599
Change-Id: Ic9ba278929f8747d58b69e7d67ec325064588bff
bstractQueue.java
rrayDeque.java
rrayPrefixHelpers.java
eque.java
ap.java
avigableMap.java
avigableSet.java
riorityQueue.java
ueue.java
plittableRandom.java
0ad21d8aa7113a444ea23eeff002c3448c7d68f5 11-Mar-2016 Narayan Kamath <narayan@google.com> Fix TreeMap serialization tests.

These are fixed by adding an explicit serialVersionUID. Note
that the jdk8 version of this class in the RI isn't serialization
compatible with the jdk7 version of this class.

bug: 27426688

(cherry picked from commit 68de3f17685a7c5ce2c3d8f2db74016bc6b9534c)

Change-Id: I7102267e5221d23d7da45180f1c76b8ea352be91
reeMap.java
68de3f17685a7c5ce2c3d8f2db74016bc6b9534c 11-Mar-2016 Narayan Kamath <narayan@google.com> Fix TreeMap serialization tests.

These are fixed by adding an explicit serialVersionUID. Note
that the jdk8 version of this class in the RI isn't serialization
compatible with the jdk7 version of this class.

bug: 27426688
Change-Id: I9a0ad778b24503f196d35b7273bdd3ddf4ccb407
reeMap.java
c353afc367d0bc83ac1c2bf33afb07e9ae0fbdff 10-Mar-2016 Narayan Kamath <narayan@google.com> Revert "Revert "Port Tim&DualPivotQuick sort changes from openJdk8""

This reverts commit 02f409d949c9d50806809b827ec503765bed34fd.

The performance regression that caused the original revert has been
identified and is unrelated to this change (though caused by an
obscure side effect of it).

bug: 27426684

Change-Id: Ie7a35a588f4042c0e1462c950e99c08e478b4cb2
rrays.java
omparableTimSort.java
ualPivotQuicksort.java
imSort.java
66193e732dc92a66ed2bd67639d2fcb7b6a9d98e 10-Mar-2016 Narayan Kamath <narayan@google.com> Merge "Add java.lang.Iterable.spliterator() and supporting classes."
8b056f0b15bc1e45da8d4c504353b05e681ac013 04-Mar-2016 Narayan Kamath <narayan@google.com> Add java.lang.Iterable.spliterator() and supporting classes.

The only android specific changes here are to HashMap - their
spliterators add Spliterator.ORDERED if the HashMap is an instance
of a LinkedHashMap.

There's some degree of duplication between the test code used to
exercise primitive arrays (Arrays / Spliterators provide similar
APIs). These differences are quite hard to consolidate, since the
Arrays version declares that their Spliterators are ORDERED but
the Spliterator version doesn't. The latter also allows us to declare
additional Spliterator characteristics.

bug: 27426688
Change-Id: I191a9319d4af7e22834f2d91f73634a227b36bc2
rrayDeque.java
rrayList.java
rrays.java
ollection.java
ollections.java
oncurrentModificationException.java
ashMap.java
ashSet.java
dentityHashMap.java
inkedHashMap.java
inkedHashSet.java
inkedList.java
ist.java
ap.java
riorityQueue.java
et.java
ortedSet.java
pliterator.java
pliterators.java
reeMap.java
reeSet.java
ector.java
eakHashMap.java
c1d958775062b6755bc14457a3368fbbbcf7538c 10-Mar-2016 Narayan Kamath <narayan@google.com> Merge "Add java.lang.Iterable.spliterator() and supporting classes." into nyc-dev
4c89023ef86f29fa9add7db2574f2169fe842577 04-Mar-2016 Narayan Kamath <narayan@google.com> Add java.lang.Iterable.spliterator() and supporting classes.

The only android specific changes here are to HashMap - their
spliterators add Spliterator.ORDERED if the HashMap is an instance
of a LinkedHashMap.

There's some degree of duplication between the test code used to
exercise primitive arrays (Arrays / Spliterators provide similar
APIs). These differences are quite hard to consolidate, since the
Arrays version declares that their Spliterators are ORDERED but
the Spliterator version doesn't. The latter also allows us to declare
additional Spliterator characteristics.

(cherry-picked from commit ed21aa3a8dcd34eca6f0317eeb683e7afdc825b9)

bug: 27426688
Change-Id: I191a9319d4af7e22834f2d91f73634a227b36bc2
rrayDeque.java
rrayList.java
rrays.java
ollection.java
ollections.java
oncurrentModificationException.java
ashMap.java
ashSet.java
dentityHashMap.java
inkedHashMap.java
inkedHashSet.java
inkedList.java
ist.java
ap.java
riorityQueue.java
et.java
ortedSet.java
pliterator.java
pliterators.java
reeMap.java
reeSet.java
ector.java
eakHashMap.java
0ac6a5fefcaa156deb671937c6a205d983be639d 08-Mar-2016 Yi Kong <yikong@google.com> Port java.util.StringJoiner from OpenJDK8

Also adds tests for java.util.StringJoiner API.

Source files are taken from jdk8u60.

Bug: 27427000
Change-Id: Ib648540a74421b41485b56bac185bad129ad5fed
(cherry picked from commit b695412b529c8dced105867c6d9d7fd463a67714)
tringJoiner.java
b695412b529c8dced105867c6d9d7fd463a67714 08-Mar-2016 Yi Kong <yikong@google.com> Port java.util.StringJoiner from OpenJDK8

Also adds tests for java.util.StringJoiner API.

Source files are taken from jdk8u60.

Bug: 27427000
Change-Id: Ib648540a74421b41485b56bac185bad129ad5fed
tringJoiner.java
b4998e53d91ce1decfa7c7634d80143626cf7fa1 09-Mar-2016 Narayan Kamath <narayan@google.com> Change links to Streams packages to {@code}.

Should be reverted once Streams has been made public.

bug: 27426738

(cherry picked from commit 01c4dc04704e34c54162b52f390623038befa514)

Change-Id: I4be985394dad9761a8dc5e8d09cab985e6af934e
oubleSummaryStatistics.java
ntSummaryStatistics.java
ongSummaryStatistics.java
01c4dc04704e34c54162b52f390623038befa514 09-Mar-2016 Narayan Kamath <narayan@google.com> Change links to Streams packages to {@code}.

Should be reverted once Streams has been made public.

bug: 27426738
Change-Id: I76bb64496a8988c6b315c99b533a40139f757ee6
oubleSummaryStatistics.java
ntSummaryStatistics.java
ongSummaryStatistics.java
540dfe93cdbe35432f3f975729c8e55e80f4e767 07-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Port OpenJDK8 java.util.*SummaryStatistics & add tests

Ported OpenJDK8 java.util.DoubleSummaryStatistics,
java.util.IntSummaryStatistics, java.util.LongSummaryStatistics.

Bug: 27426738

(cherry picked from commit 49b5e20d6e5c17985c141fff49f135b05284b62d)

Change-Id: I759b2a2aac3fb5c19b9f737dcb71697890bec4bb
oubleSummaryStatistics.java
ntSummaryStatistics.java
ongSummaryStatistics.java
9cd8abc409125468e500cc5b192e88bbabadc56f 09-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Port OpenJDK8 java.util.*SummaryStatistics & add tests"
a8da445cdc91374ed0e105686feefd7e8ed79dc1 04-Mar-2016 Yi Kong <yikong@google.com> Port java.util.Comparator{,s} from OpenJDK8

Also adds tests for java.util.Comparator API.

Source files are taken from jdk8u60.

Bug: 27427010
Change-Id: Id71eb7fa92c28720c13da8fd0f5f193151b6a43d
(cherry picked from commit f121f31fd91c5a557225cd6a97418e716529eb2d)
ollections.java
omparator.java
omparators.java
49b5e20d6e5c17985c141fff49f135b05284b62d 07-Mar-2016 Shubham Ajmera <shubhamajmera@google.com> Port OpenJDK8 java.util.*SummaryStatistics & add tests

Ported OpenJDK8 java.util.DoubleSummaryStatistics,
java.util.IntSummaryStatistics, java.util.LongSummaryStatistics.

Bug: 27426738

Change-Id: Ie8e3f7fc148615c38f2cf7bce971617599d00813
oubleSummaryStatistics.java
ntSummaryStatistics.java
ongSummaryStatistics.java
f121f31fd91c5a557225cd6a97418e716529eb2d 04-Mar-2016 Yi Kong <yikong@google.com> Port java.util.Comparator{,s} from OpenJDK8

Also adds tests for java.util.Comparator API.

Source files are taken from jdk8u60.

Bug: 27427010
Change-Id: Id71eb7fa92c28720c13da8fd0f5f193151b6a43d
ollections.java
omparator.java
omparators.java
02f409d949c9d50806809b827ec503765bed34fd 08-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Revert "Port Tim&DualPivotQuick sort changes from openJdk8"

This reverts commit 2d5f13085d5a82ba648a244a58f834bf438a979b.

Change-Id: Iaf346068b6c0380a45bcfbff27abdf5cd31a8fcc
rrays.java
omparableTimSort.java
ualPivotQuicksort.java
imSort.java
2d5f13085d5a82ba648a244a58f834bf438a979b 01-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port Tim&DualPivotQuick sort changes from openJdk8

This change adds an ability to invoke a sort on a sub-range
inside an array. Follow-up change will add new Arrays.parallelSort
methods.

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27426684
Change-Id: I54e3ff61049fdc9a08fbaa6a10b07d2620f7172d
(cherry picked from commit a124e09d2ab78d9291a6fb9a48845a55a12491a2)
rrays.java
omparableTimSort.java
ualPivotQuicksort.java
imSort.java
a71c780559190439211e731ea8ecf1e0291685d9 04-Mar-2016 Narayan Kamath <narayan@google.com> Fix ArrayDeque forEachRemaining tests.

bug: 27426688

(cherry picked from commit 3de87b847fa94cce9beaf5b225404c1bc7ec475f)

Change-Id: Id5703cf10a673f2bb0caba6ded0fec12a468c674
rrayDeque.java
3de87b847fa94cce9beaf5b225404c1bc7ec475f 04-Mar-2016 Narayan Kamath <narayan@google.com> Fix ArrayDeque forEachRemaining tests.

Change-Id: Ibcc637d77d6ae1332fc9cc99e3915f23482db5a8
rrayDeque.java
3a7c42e33ad0c5f5e11b64161781ca24b8f82a6d 03-Mar-2016 Narayan Kamath <narayan@google.com> Add java.util.PrimitiveIterator and tests.

bug: 27426688

(cherry picked from commit e86a81ca1ae9ddbdd1c3239d31fb2e49b4a5cf33)

Change-Id: I248baa721fe15eae8787f9baaea0c5a7130fb7a5
rimitiveIterator.java
ripwire.java
e86a81ca1ae9ddbdd1c3239d31fb2e49b4a5cf33 03-Mar-2016 Narayan Kamath <narayan@google.com> Add java.util.PrimitiveIterator and tests.

bug: 27426688
Change-Id: Iba1e630e2fb6bf063f4b40ead39848320acb4660
rimitiveIterator.java
ripwire.java
3984cdba314a0f7b0587000dec99ff26fd9bcbb5 02-Mar-2016 Narayan Kamath <narayan@google.com> Add Iterator.forEachRemaining / Iterator.remove.

Also pulls in various specializations from concrete subclasses.

bug: 27426688

(cherry picked from commit e633814ad4dc6c7dc0c34080292c2c9622cbd5a3)

Change-Id: Ic778fb61768ec2495e1ac17029afbdfd97d5e6db
rrayDeque.java
rrayList.java
ollections.java
terator.java
inkedList.java
ector.java
be0e537d8953365ae5a008350461ccf777a719fb 16-Oct-2015 Neil Fuller <nfuller@google.com> Refresh of upstream JSR166 code

This is a pull of same code we should already have.
This is the version of classes found in the jdk7/
dir.

cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout -D "03/24/2015 22:30:53 GMT" jsr166

Most Android modifications have been reapplied excluding
some changes to NullPointerException constructor
arguments). The majority of the changes are documentation
cleanups, with the exception of ArrayDeque.

Bug: 24726356

(cherry picked from commit fd81a99407d318ea3d8b5782294a0644e580d126)

Change-Id: If2f85be682d0811092abca720502ed13fa4e1769
bstractQueue.java
rrayDeque.java
eque.java
avigableMap.java
avigableSet.java
ueue.java
e633814ad4dc6c7dc0c34080292c2c9622cbd5a3 02-Mar-2016 Narayan Kamath <narayan@google.com> Add Iterator.forEachRemaining / Iterator.remove.

Also pulls in various specializations from concrete subclasses.

bug: 27426688
Change-Id: I4d37bb61973447b5621fc2b389a04d40666a941d
rrayDeque.java
rrayList.java
ollections.java
terator.java
inkedList.java
ector.java
cd74ab122b3c80d7fd7111105940db13e045f4aa 02-Mar-2016 Narayan Kamath <narayan@google.com> Port java.util.Optional and friends from OpenJdk8.

bug: 27423298

(cherry picked from commit b0576a2458c789126957917d8d9cf2a58ec6762a)

Change-Id: If98b4c1764b406fb6caa5ee9b2a4ebe633bc21e1
ptional.java
ptionalDouble.java
ptionalInt.java
ptionalLong.java
b0576a2458c789126957917d8d9cf2a58ec6762a 02-Mar-2016 Narayan Kamath <narayan@google.com> Port java.util.Optional and friends from OpenJdk8.

bug: 27423298

Change-Id: I72cdb87ee80d7a1fe9df1747a0bcca2a5524348e
ptional.java
ptionalDouble.java
ptionalInt.java
ptionalLong.java
fd81a99407d318ea3d8b5782294a0644e580d126 16-Oct-2015 Neil Fuller <nfuller@google.com> Refresh of upstream JSR166 code

This is a pull of same code we should already have.
This is the version of classes found in the jdk7/
dir.

cvs -d ':pserver:anonymous@gee.cs.oswego.edu/home/jsr166/jsr166' checkout -D "03/24/2015 22:30:53 GMT" jsr166

Most Android modifications have been reapplied excluding
some changes to NullPointerException constructor
arguments). The majority of the changes are documentation
cleanups, with the exception of ArrayDeque.

Bug: 24726356
Change-Id: I61932856f77ecd7637b8bdfab34512b4df7b58ea
bstractQueue.java
rrayDeque.java
eque.java
avigableMap.java
avigableSet.java
ueue.java
a124e09d2ab78d9291a6fb9a48845a55a12491a2 01-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Port Tim&DualPivotQuick sort changes from openJdk8

This change adds an ability to invoke a sort on a sub-range
inside an array. Follow-up change will add new Arrays.parallelSort
methods.

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27426684
Change-Id: I54e3ff61049fdc9a08fbaa6a10b07d2620f7172d
rrays.java
omparableTimSort.java
ualPivotQuicksort.java
imSort.java
60796efea3a74e02aea384b8eb56103ea21b880b 29-Feb-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add Iterable#forEach & Map#forEach from openJdk8

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27404545
Change-Id: Ic67e20b35c24e7acce513e010b727510af09a83e
(cherry picked from commit c3a9db83a352d92d5a6e0098f22bde07e34a1d3b)
rrayList.java
rrays.java
ollections.java
ashMap.java
ashtable.java
dentityHashMap.java
inkedHashMap.java
ap.java
reeMap.java
ector.java
eakHashMap.java
38e7d1adcb38789aae5f04979708c8497c48866f 01-Mar-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Add Iterable#forEach & Map#forEach from openJdk8"
c3a9db83a352d92d5a6e0098f22bde07e34a1d3b 29-Feb-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Add Iterable#forEach & Map#forEach from openJdk8

Based on openJdk 8u40 source & iam@ stream change in
ag/872080

Bug: 27404545
Change-Id: Ic67e20b35c24e7acce513e010b727510af09a83e
rrayList.java
rrays.java
ollections.java
ashMap.java
ashtable.java
dentityHashMap.java
inkedHashMap.java
ap.java
reeMap.java
ector.java
eakHashMap.java
2895195aa2810f4424cf36347f1998b3af08bc52 23-Feb-2016 Narayan Kamath <narayan@google.com> Observable: Clean up and generify observable.

- Use ArrayList<Observer> instead of Vector

- Clearer variable names. (|observers| instead of |obs|). This also
fixes issues with apps that were dependant on the name of this
variable. I emphasize here that this change is only being made because
the new variable name is cleaner. Apps must NOT depend on private
implementation details.

bug: 26937230

(cherry picked from commit 637199ac0a9cdee94d6293ee4267ce6e14bec495)

Change-Id: I37030ace068e10942f64caae243f2aad2cb4bcfe
bservable.java
637199ac0a9cdee94d6293ee4267ce6e14bec495 23-Feb-2016 Narayan Kamath <narayan@google.com> Observable: Clean up and generify observable.

- Use ArrayList<Observer> instead of Vector

- Clearer variable names. (|observers| instead of |obs|). This also
fixes issues with apps that were dependant on the name of this
variable. I emphasize here that this change is only being made because
the new variable name is cleaner. Apps must NOT depend on private
implementation details.

bug: 26937230
Change-Id: I0757157ccb158e400a9513a1464b19298b465233
bservable.java
4b92e5b21380a5344e5808b17ddffb994f855288 19-Jan-2016 Neil Fuller <nfuller@google.com> Unhide java.util.function

Bug: 26814204
(cherry-picked from commit 2278037aa1653a32014df55f325879b4fe75fc27)

Change-Id: Ib3aacb38ed5afcee125c4c6dd9f27933121af380
bjects.java
unction/BiConsumer.java
unction/BiFunction.java
unction/BiPredicate.java
unction/BinaryOperator.java
unction/BooleanSupplier.java
unction/Consumer.java
unction/DoubleBinaryOperator.java
unction/DoubleConsumer.java
unction/DoubleFunction.java
unction/DoublePredicate.java
unction/DoubleSupplier.java
unction/DoubleToIntFunction.java
unction/DoubleToLongFunction.java
unction/DoubleUnaryOperator.java
unction/Function.java
unction/IntBinaryOperator.java
unction/IntConsumer.java
unction/IntFunction.java
unction/IntPredicate.java
unction/IntSupplier.java
unction/IntToDoubleFunction.java
unction/IntToLongFunction.java
unction/IntUnaryOperator.java
unction/LongBinaryOperator.java
unction/LongConsumer.java
unction/LongFunction.java
unction/LongPredicate.java
unction/LongSupplier.java
unction/LongToDoubleFunction.java
unction/LongToIntFunction.java
unction/LongUnaryOperator.java
unction/ObjDoubleConsumer.java
unction/ObjIntConsumer.java
unction/ObjLongConsumer.java
unction/Predicate.java
unction/Supplier.java
unction/ToDoubleBiFunction.java
unction/ToDoubleFunction.java
unction/ToIntBiFunction.java
unction/ToIntFunction.java
unction/ToLongBiFunction.java
unction/ToLongFunction.java
unction/UnaryOperator.java
unction/package-info.java
e053d5ee5eea301559822c98e69874344c971502 19-Jan-2016 Neil Fuller <nfuller@google.com> Add java.util.function code

Marked with @hide for now.

Bug: 26814204
(cherry-picked from commit 607050af5a16c46ae53ff4d2c3f47b4ef694b559)

Change-Id: If6a82664a7b613a5eb02acbbb08eeb6e30a0004d
bjects.java
unction/BiConsumer.java
unction/BiFunction.java
unction/BiPredicate.java
unction/BinaryOperator.java
unction/BooleanSupplier.java
unction/Consumer.java
unction/DoubleBinaryOperator.java
unction/DoubleConsumer.java
unction/DoubleFunction.java
unction/DoublePredicate.java
unction/DoubleSupplier.java
unction/DoubleToIntFunction.java
unction/DoubleToLongFunction.java
unction/DoubleUnaryOperator.java
unction/Function.java
unction/IntBinaryOperator.java
unction/IntConsumer.java
unction/IntFunction.java
unction/IntPredicate.java
unction/IntSupplier.java
unction/IntToDoubleFunction.java
unction/IntToLongFunction.java
unction/IntUnaryOperator.java
unction/LongBinaryOperator.java
unction/LongConsumer.java
unction/LongFunction.java
unction/LongPredicate.java
unction/LongSupplier.java
unction/LongToDoubleFunction.java
unction/LongToIntFunction.java
unction/LongUnaryOperator.java
unction/ObjDoubleConsumer.java
unction/ObjIntConsumer.java
unction/ObjLongConsumer.java
unction/Predicate.java
unction/Supplier.java
unction/ToDoubleBiFunction.java
unction/ToDoubleFunction.java
unction/ToIntBiFunction.java
unction/ToIntFunction.java
unction/ToLongBiFunction.java
unction/ToLongFunction.java
unction/UnaryOperator.java
unction/package-info.java
fa07c88938c939eea9770e52f4813476e4ba6f3b 12-Feb-2016 Narayan Kamath <narayan@google.com> ZipFile: Improve performance for ZipFile.<init>

Avoid thousands of JNI transitions in the constructor. We can
quite easily check for invalid entry names and duplicates while
parsing the central directory in native code.

The benchmarks show that the median time for opening a file with 8192
entries decreased from 488ms to 120us.

AFTER:
Trial Report (1 of 3):
Experiment {instrument=runtime, benchmarkMethod=timeZipFileOpen, vm=default, parameters={numEntries=128}}
Results:
runtime(ns): min=112794.57, 1st qu.=113238.72, median=114539.28, mean=119694.66, 3rd qu.=125191.84, max=143145.02
Trial Report (2 of 3):
Experiment {instrument=runtime, benchmarkMethod=timeZipFileOpen, vm=default, parameters={numEntries=1024}}
Results:
runtime(ns): min=112868.04, 1st qu.=113582.70, median=115180.93, mean=117760.32, 3rd qu.=118067.87, max=137760.10
Trial Report (3 of 3):
Experiment {instrument=runtime, benchmarkMethod=timeZipFileOpen, vm=default, parameters={numEntries=8192}}
Results:
runtime(ns): min=112417.27, 1st qu.=114630.16, median=117272.70, mean=119197.74, 3rd qu.=122742.84, max=135330.50

BEFORE:
Trial Report (1 of 3):
Experiment {instrument=runtime, benchmarkMethod=benchmarkZipFileOpen, vm=default, parameters={numEntries=128}}
Results:
runtime(ns): min=9360144.37, 1st qu.=9559712.86, median=9839983.50, mean=9816559.27, 3rd qu.=10057399.81, max=10170918.14
Trial Report (2 of 3):
Experiment {instrument=runtime, benchmarkMethod=benchmarkZipFileOpen, vm=default, parameters={numEntries=1024}}
Results:
runtime(ns): min=60682471.64, 1st qu.=62388598.00, median=64319977.57, mean=66545494.60, 3rd qu.=72114121.64, max=77298980.57
Trial Report (3 of 3):
Experiment {instrument=runtime, benchmarkMethod=benchmarkZipFileOpen, vm=default, parameters={numEntries=8192}}
Results:
runtime(ns): min=485804479.00, 1st qu.=487322656.00, median=488986250.00, mean=489820034.67, 3rd qu.=492383229.50, max=495372604.00

bug: 27145664

(cherry picked from commit 8c6a910cd20026c9181a46c8e800a4a566f14527)

Change-Id: Ic1bfe934548f7baf8b8789f069f654725a4b228b
ip/ZipFile.java
8c6a910cd20026c9181a46c8e800a4a566f14527 12-Feb-2016 Narayan Kamath <narayan@google.com> ZipFile: Improve performance for ZipFile.<init>

Avoid thousands of JNI transitions in the constructor. We can
quite easily check for invalid entry names and duplicates while
parsing the central directory in native code.

The benchmarks show that the median time for opening a file with 8192
entries decreased from 488ms to 120us.

AFTER:
Trial Report (1 of 3):
Experiment {instrument=runtime, benchmarkMethod=timeZipFileOpen, vm=default, parameters={numEntries=128}}
Results:
runtime(ns): min=112794.57, 1st qu.=113238.72, median=114539.28, mean=119694.66, 3rd qu.=125191.84, max=143145.02
Trial Report (2 of 3):
Experiment {instrument=runtime, benchmarkMethod=timeZipFileOpen, vm=default, parameters={numEntries=1024}}
Results:
runtime(ns): min=112868.04, 1st qu.=113582.70, median=115180.93, mean=117760.32, 3rd qu.=118067.87, max=137760.10
Trial Report (3 of 3):
Experiment {instrument=runtime, benchmarkMethod=timeZipFileOpen, vm=default, parameters={numEntries=8192}}
Results:
runtime(ns): min=112417.27, 1st qu.=114630.16, median=117272.70, mean=119197.74, 3rd qu.=122742.84, max=135330.50

BEFORE:
Trial Report (1 of 3):
Experiment {instrument=runtime, benchmarkMethod=benchmarkZipFileOpen, vm=default, parameters={numEntries=128}}
Results:
runtime(ns): min=9360144.37, 1st qu.=9559712.86, median=9839983.50, mean=9816559.27, 3rd qu.=10057399.81, max=10170918.14
Trial Report (2 of 3):
Experiment {instrument=runtime, benchmarkMethod=benchmarkZipFileOpen, vm=default, parameters={numEntries=1024}}
Results:
runtime(ns): min=60682471.64, 1st qu.=62388598.00, median=64319977.57, mean=66545494.60, 3rd qu.=72114121.64, max=77298980.57
Trial Report (3 of 3):
Experiment {instrument=runtime, benchmarkMethod=benchmarkZipFileOpen, vm=default, parameters={numEntries=8192}}
Results:
runtime(ns): min=485804479.00, 1st qu.=487322656.00, median=488986250.00, mean=489820034.67, 3rd qu.=492383229.50, max=495372604.00

bug: 27145664

Change-Id: I510e923ac54d52082b9eafa0f151ad4f71826333
ip/ZipFile.java
c514380e14eafe28505ee3c8ccf0f64951a73965 19-Jan-2016 Neil Fuller <nfuller@google.com> Unhide java.util.function

Bug: 26814204
(cherry picked from commit 2278037aa1653a32014df55f325879b4fe75fc27)

Change-Id: I4ae0220eebb722748109c4dc3210dadfbc82f29a
bjects.java
unction/BiConsumer.java
unction/BiFunction.java
unction/BiPredicate.java
unction/BinaryOperator.java
unction/BooleanSupplier.java
unction/Consumer.java
unction/DoubleBinaryOperator.java
unction/DoubleConsumer.java
unction/DoubleFunction.java
unction/DoublePredicate.java
unction/DoubleSupplier.java
unction/DoubleToIntFunction.java
unction/DoubleToLongFunction.java
unction/DoubleUnaryOperator.java
unction/Function.java
unction/IntBinaryOperator.java
unction/IntConsumer.java
unction/IntFunction.java
unction/IntPredicate.java
unction/IntSupplier.java
unction/IntToDoubleFunction.java
unction/IntToLongFunction.java
unction/IntUnaryOperator.java
unction/LongBinaryOperator.java
unction/LongConsumer.java
unction/LongFunction.java
unction/LongPredicate.java
unction/LongSupplier.java
unction/LongToDoubleFunction.java
unction/LongToIntFunction.java
unction/LongUnaryOperator.java
unction/ObjDoubleConsumer.java
unction/ObjIntConsumer.java
unction/ObjLongConsumer.java
unction/Predicate.java
unction/Supplier.java
unction/ToDoubleBiFunction.java
unction/ToDoubleFunction.java
unction/ToIntBiFunction.java
unction/ToIntFunction.java
unction/ToLongBiFunction.java
unction/ToLongFunction.java
unction/UnaryOperator.java
unction/package-info.java
7cc411351c4d835e686943748e73f4b59c5b2825 05-Feb-2016 Paul Duffin <paulduffin@google.com> Merge "Adjust for DST properly in GregorianCalendar.add(int,int)." am: 78ce47a5ef
am: 90366798ea

* commit '90366798ea583934c0d09a1ddaf533b3ecb2a2cb':
Adjust for DST properly in GregorianCalendar.add(int,int).
e074332ca844f4eda7440813fa2a4fe137cdf430 03-Feb-2016 Paul Duffin <paulduffin@google.com> Adjust for DST properly in GregorianCalendar.add(int,int).

Use the adjustForZoneAndDaylightSavingsTime() added in change
196553 to handle computing the time in millis in the
add(int,int) method. The removed code was very confusing as it
relied on side effects of calls to setTimeInMillis() a lot.

Removed an unnecessary fieldMask parameter from the
adjustForZoneAndDaylightSavingsTime() method, it was duplicating
information provided by tzMask.

Bug: 26022884
Change-Id: I476112cad93642340ff23779fa1902cbd0fa8e25
regorianCalendar.java
d901e7bcc649a04de1c8eb5df05632113cc29e05 04-Feb-2016 Neil Fuller <nfuller@google.com> Merge "Revert "Unhide java.util.function""
d052fb54474c6e3d99da861b02e4b49ac98790cc 04-Feb-2016 Neil Fuller <nfuller@google.com> Revert "Unhide java.util.function"

Premature submission. Need to wait until stubs support 1.8.

This reverts commit 2278037aa1653a32014df55f325879b4fe75fc27.

Change-Id: I3c463ac5a2d0a0fd0be918d61923b54b6ea85c7f
bjects.java
unction/BiConsumer.java
unction/BiFunction.java
unction/BiPredicate.java
unction/BinaryOperator.java
unction/BooleanSupplier.java
unction/Consumer.java
unction/DoubleBinaryOperator.java
unction/DoubleConsumer.java
unction/DoubleFunction.java
unction/DoublePredicate.java
unction/DoubleSupplier.java
unction/DoubleToIntFunction.java
unction/DoubleToLongFunction.java
unction/DoubleUnaryOperator.java
unction/Function.java
unction/IntBinaryOperator.java
unction/IntConsumer.java
unction/IntFunction.java
unction/IntPredicate.java
unction/IntSupplier.java
unction/IntToDoubleFunction.java
unction/IntToLongFunction.java
unction/IntUnaryOperator.java
unction/LongBinaryOperator.java
unction/LongConsumer.java
unction/LongFunction.java
unction/LongPredicate.java
unction/LongSupplier.java
unction/LongToDoubleFunction.java
unction/LongToIntFunction.java
unction/LongUnaryOperator.java
unction/ObjDoubleConsumer.java
unction/ObjIntConsumer.java
unction/ObjLongConsumer.java
unction/Predicate.java
unction/Supplier.java
unction/ToDoubleBiFunction.java
unction/ToDoubleFunction.java
unction/ToIntBiFunction.java
unction/ToIntFunction.java
unction/ToLongBiFunction.java
unction/ToLongFunction.java
unction/UnaryOperator.java
unction/package-info.java
03f7f6b0020d10bd485a3db62429c101ccaf877d 04-Feb-2016 Neil Fuller <nfuller@google.com> Merge "Unhide java.util.function"
249990496fd48ea58e1f73d644e98040d3a92080 03-Feb-2016 Neil Fuller <nfuller@google.com> Merge "Add java.util.function code"
67516f52583ccb2164cc3a3a40c0863bf5b18875 01-Feb-2016 Narayan Kamath <narayan@google.com> WeakHashMap: Remove some unnecessary lazy initialization.

If altHashing is true, we will almost always use the hashCode, so
there's no point lazily initializing it (and paying for an additional
field and synchronization).

Note that altHashing is turned off by default.

Change-Id: I08a4064846a549a186e397f63dee968ea7388a03
eakHashMap.java
f37dcda672c24f29269578defc6fc7c1615f4cd4 02-Feb-2016 Narayan Kamath <narayan@google.com> ZipEntry: Update comment.

Change-Id: Iff15962ca474e245f736d5a8bd1c2d29a608a85b
ip/ZipEntry.java
2278037aa1653a32014df55f325879b4fe75fc27 19-Jan-2016 Neil Fuller <nfuller@google.com> Unhide java.util.function

Bug: 26814204
Change-Id: If0efd904dfd6caede594e60b1fab843f1ae6b761
bjects.java
unction/BiConsumer.java
unction/BiFunction.java
unction/BiPredicate.java
unction/BinaryOperator.java
unction/BooleanSupplier.java
unction/Consumer.java
unction/DoubleBinaryOperator.java
unction/DoubleConsumer.java
unction/DoubleFunction.java
unction/DoublePredicate.java
unction/DoubleSupplier.java
unction/DoubleToIntFunction.java
unction/DoubleToLongFunction.java
unction/DoubleUnaryOperator.java
unction/Function.java
unction/IntBinaryOperator.java
unction/IntConsumer.java
unction/IntFunction.java
unction/IntPredicate.java
unction/IntSupplier.java
unction/IntToDoubleFunction.java
unction/IntToLongFunction.java
unction/IntUnaryOperator.java
unction/LongBinaryOperator.java
unction/LongConsumer.java
unction/LongFunction.java
unction/LongPredicate.java
unction/LongSupplier.java
unction/LongToDoubleFunction.java
unction/LongToIntFunction.java
unction/LongUnaryOperator.java
unction/ObjDoubleConsumer.java
unction/ObjIntConsumer.java
unction/ObjLongConsumer.java
unction/Predicate.java
unction/Supplier.java
unction/ToDoubleBiFunction.java
unction/ToDoubleFunction.java
unction/ToIntBiFunction.java
unction/ToIntFunction.java
unction/ToLongBiFunction.java
unction/ToLongFunction.java
unction/UnaryOperator.java
unction/package-info.java
607050af5a16c46ae53ff4d2c3f47b4ef694b559 19-Jan-2016 Neil Fuller <nfuller@google.com> Add java.util.function code

Marked with @hide for now.

Bug: 26814204
Change-Id: I82f0b822b25740e3480dac8a0fd32ae3bca7f183
bjects.java
unction/BiConsumer.java
unction/BiFunction.java
unction/BiPredicate.java
unction/BinaryOperator.java
unction/BooleanSupplier.java
unction/Consumer.java
unction/DoubleBinaryOperator.java
unction/DoubleConsumer.java
unction/DoubleFunction.java
unction/DoublePredicate.java
unction/DoubleSupplier.java
unction/DoubleToIntFunction.java
unction/DoubleToLongFunction.java
unction/DoubleUnaryOperator.java
unction/Function.java
unction/IntBinaryOperator.java
unction/IntConsumer.java
unction/IntFunction.java
unction/IntPredicate.java
unction/IntSupplier.java
unction/IntToDoubleFunction.java
unction/IntToLongFunction.java
unction/IntUnaryOperator.java
unction/LongBinaryOperator.java
unction/LongConsumer.java
unction/LongFunction.java
unction/LongPredicate.java
unction/LongSupplier.java
unction/LongToDoubleFunction.java
unction/LongToIntFunction.java
unction/LongUnaryOperator.java
unction/ObjDoubleConsumer.java
unction/ObjIntConsumer.java
unction/ObjLongConsumer.java
unction/Predicate.java
unction/Supplier.java
unction/ToDoubleBiFunction.java
unction/ToDoubleFunction.java
unction/ToIntBiFunction.java
unction/ToIntFunction.java
unction/ToLongBiFunction.java
unction/ToLongFunction.java
unction/UnaryOperator.java
unction/package-info.java
3af4662f6f624863e2cf72cfb8ab56b70a1e0355 29-Jan-2016 Paul Duffin <paulduffin@google.com> Restore ZoneInfo specific code in GregorianCalendar

During removal of the sun.util.calendar.ZoneInfo class from
OpenJDK some code was removed from GregorianCalendar that cast
the TimeZone to ZoneInfo in order to call a special method in
ZoneInfo to get the raw and DST offset. The removed code was
necessary because the package private method in TimeZone
getOffsets(long, int[]) that provided them separately could not
be overridden by ZoneInfo, the public method getOffset(long) did
not support providing them separately, and attempts to calculate
the DST offset (by subtracting getRawOffset()) from the total
offset did not work properly with ZoneInfo when it had historic
changes to the DST and raw offset.

The result of the removal was that GregorianCalendar had an
inconsistent view of TimeZone which lead to the time calculated
by GregorianCalendar being out by a couple of hours either way
depending on the difference between the applicable offset and
the 'default' offset.

This adds a method in ZoneInfo to return the raw and DST offsets
separately and then adds back in the special code to call that
method in GregorianCalendar. This fixes a number of CalendarTest
failures, including testSetHourOfDayInEuropeLondon. It should
also fix some reported bugs in a number of apps, including
Calendar.

Bug: 26869497
Change-Id: Ia780b628ef951aec6fd08de1cebc7b6e904f77b0
regorianCalendar.java
65073e8335b6da12f2ee21c71283440073299c7b 27-Jan-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove java.nio.file package

This package has no test coverage, and we don't
know if it was ported properly. This package will
be added in future, with a test suite.

Bug: 26786186
Bug: 26812611
Change-Id: I998ff89cef4029e39c2ca0d3ac5cb54058f93758
canner.java
e0c43b0b6ee87b14972769634cac75b49bb8c5de 27-Jan-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove java.nio.file package

This package has no test coverage, and we don't
know if it was ported properly. This package will
be added in future, with a test suite.

Bug: 26786186
Bug: 26812611
Change-Id: I30a35f57be38fbf2b760e7d821bd2e233d2eaecb
canner.java
00b71736c88addbe7cb5fa00b194695dde40a3a6 22-Jan-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix incorrect @hide usage

@hide annotation is only effective in Javadoc.

Bug: 26689841
Change-Id: Ice76dc2e291f475b3cac06d4240953cb7440ab40
(cherry picked from commit 1550ed9ba326ce08cef8ebf01699a49fabdc64f3)
ar/JarFile.java
857a579353a7ffbcf14047bb837989dd1937faba 22-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Fix LogManager tests" am: 96b3a20bd6
am: 67f71d8646

* commit '67f71d8646548da630295bb0bf9268d55219d000':
Fix LogManager tests
1550ed9ba326ce08cef8ebf01699a49fabdc64f3 22-Jan-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix incorrect @hide usage

@hide annotation is only effective in Javadoc.

Bug: 26689841
Change-Id: Ice76dc2e291f475b3cac06d4240953cb7440ab40
ar/JarFile.java
358597ba415922a6d8c244f10e159b7ec882ad54 20-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Fix LogManager tests

Fix testMockGetProperty, testReset.

LogManager is a singleton class, however, the test generates multiple
instance of it using MockLogManger class which inherits
LogManager. addLocalLogger in LoggerContext class uses the singleton
instance(which ideally should be the only instance) for setting the
level of the logger which creates inconsistency in data. The change adds
compatibilitiy for the test to use MockLogManager.

Bug: 25861348

Change-Id: I98fa0883c4687180059abf995519e997c8fadddf
ogging/LogManager.java
3f3582d1853c053a9002cd6850ffb40ec7864e4c 19-Jan-2016 Paul Duffin <paulduffin@google.com> Fix NullPointerException in Calendar constructor

The test_nulllocale checked three different cases so I split
it into three separate tests. They all failed in the same way
so I fixed them in the common place. Although the tests had a
TODO to add a targetSdkVersion check I did not do that.

Bug: 26022884
Change-Id: Icab2b4c834609a0b0f84f5f86570067019688611
alendar.java
319bdb20629d90b632aa6fb6bcd3ff9577ec8715 19-Jan-2016 Paul Duffin <paulduffin@google.com> Merge "Fix setting a calendar to a time during transition into DST"
c050c74b3078c21a0111a20142d0b161b10a6507 19-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Fix XMLFormatterTest#testInvalidParameter"
d2b5e2c09537ebbf54908d8d9233f2c8f582e8cc 18-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Fix LogManager related tests"
91f79eabd9e312ec0fa536410d5b6aa8edba2aeb 18-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Fix LevelTest#testGetLocalName"
90a3721dc9454a67e1c64409782d277424d38fc3 14-Jan-2016 Paul Duffin <paulduffin@google.com> Fix setting a calendar to a time during transition into DST

The transition into Daylight Savings Time (DST), i.e. spring
forward, results in a period of time (equal to the DST offset)
during which the wall clock time is incorrect. Basically, the
GregorianCalendar does not handle that situation properly and
calculates the wrong UTC time (in millis since 1st January
1970).

The reason this exists in Enso is because in OpenJDK the
handling of that situation is not performed directly in
GregorianCalendar computeTime() but instead in a special method
in sun.util.calendar.ZoneInfo. That means OpenJDK has similar
behavior to enso when a different TimeZone implementation, such
as SimpleTimeZone is used. That special code was removed so it
fell back to the code that is used for SimpleTimeZone which is
broken.

In pre-enso GregorianCalendar has a special method getOffset()
that is called for all instances of TimeZone that handles the
case so unlike OpenJDK it does work for SimpleTimeZone.

The solution is to add some code into GregorianCalendar that
handles the transition into DST specially. That means it will
work the same as pre-enso, not OpenJDK for SimpleTimeZone. As
it is complex I have refactored the code a bit more than
necessary in order to improve the structure and add some extra
documentation. I also added extra tests, some of which do not
work in OpenJDK.

Bug: 25897679
Change-Id: I06d0c81e8da20ec00267ed8ba24b26a8a2c163ed
regorianCalendar.java
ed0a7b5290c302f8c58fdb3fb4ed8df5e0d32bd4 15-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Fix LevelTest#testGetLocalName

Bug: 25861348
Change-Id: I4ef5b4535d0c52d62817639016e78d19b50fa0ee
ogging/Level.java
07c4a0eab5348a975ea278d17afdd608270d0f53 18-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Fix LogRecordTest#testSerializationResourceBundle

Bug: 25861348
Change-Id: I9810c544b3b7665165751af92309c118854dd32c
ogging/LogRecord.java
581dd25dd2a6930f72ebca0e88250934e8cd6e6e 16-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Fix LogManager related tests

Fix testDefaultLoggerProperties, testGetProperty,
testGlobalPropertyConfig, testReadConfigurationInputStream_root.

At some points, only the SystemClassLoader is used which fails to find
the classes required in the tests. A correction for the same has been
made to find the classes using ContextClassLoader.

Bug: 25861348

Change-Id: Ifb5f72163b3ee9905850fc050f5e6045f7efdd6e
ogging/LogManager.java
331f0f0d4a4148fc934d44f16829b14def6c10f6 14-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Fix XMLFormatterTest#testInvalidParameter

Bug: 25861348
Change-Id: Ie3a60d9835d578f5a4067832b5c4483b9bf77046
ogging/XMLFormatter.java
2f83edd90a5e364207421598bf00360c7f689689 12-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Implement java.util.Currency using ICU4J"
2f7224868a7fa789e221d2046a32b767e7564790 12-Jan-2016 Kenny Root <kroot@google.com> Merge "Fix HashMap and HashSet cloning problem"
7e3c9197dd6819e459d95e986cb028b61e708da1 08-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Implement java.util.Currency using ICU4J

java.util.Currency uses android.icu.util.Currency as the wrapper class.

Change-Id: Ia67e5b83ed62d06fa53dfb7bcc42cdfb784df40c
urrency.java
b31a117de532a94827fc4b072e2d907a89e7a91c 11-Jan-2016 Narayan Kamath <narayan@google.com> Formatter: Use localized exponent separator for %e.

bug: 26023758
Change-Id: Ie800e20a99517c9bd0a1c5b1a306b028d019f62d
ormatter.java
189d3d5eb6b6ff364889df280f6a1911aae09b91 08-Jan-2016 Narayan Kamath <narayan@google.com> InflaterInputStream : Unconditionally close external inflaters.

bug: 26462400
Change-Id: Iee06e72f6913b67cea13c0c2f818cb12f9985019
ip/GZIPInputStream.java
ip/InflaterInputStream.java
ip/ZipInputStream.java
44973ad1b6b55b8afa2aba3abad8166e31e772d5 12-Jan-2016 Kenny Root <kroot@google.com> Fix HashMap and HashSet cloning problem

If HashMap or HashSet were cloned, it would no longer be equal to
"EMPTY_TABLE" causing the next insertion into the map to be inserted at
an index that was out of bounds.

Bug: 26294011
Change-Id: I374ed126d0d2fa725d6a7f86a6e419cb34ff9ce9
ashMap.java
35b5ac0ecdb74a6a55cb6757675537e31e94474e 11-Jan-2016 Narayan Kamath <narayan@google.com> Formatter: Case strings according the provided locale.

bug: 26023758
Change-Id: I88126f24511792ba7850b068e6c5113494d9bf0f
ormatter.java
f3bb5a03f7771ab29dd7fe409778c38dff6a8fb5 08-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Merge "Fix de-serialization issue in java.util.Locale"
9bd6371468aac3ddaa7057127d5ef152aea1227d 06-Jan-2016 Narayan Kamath <narayan@google.com> Re-enable closeguard on a few classes that were missing it.

Change-Id: I49f580dbd02def75584a00edc849c2b3fbdb8aec
ip/Deflater.java
ip/Inflater.java
ip/ZipFile.java
8ac8497d1ef1b65c30790d09ff59da37b910cdec 07-Jan-2016 Shubham Ajmera <shubhamajmera@google.com> Fix de-serialization issue in java.util.Locale

Added a test for the same.

Bug: 26387905
Change-Id: I1d4e3d4dffd4b4c3cf22b594dd41a93e1bc176e4
ocale.java
575aa517e3f65beff6626311885293d0dac9a593 06-Jan-2016 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Re-enable libcore.java.util.LocaleTest with fix"
f0326f648e129bbe6d28dd68c5eada7d9ff40e47 30-Dec-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Re-enable libcore.java.util.LocaleTest with fix

- This time it wont break the build
- Remove side-effects from initDefault and make
it accessible from LocaleTest.
- initDefaults reads "user.locale" first
- Fixed failing tests in LocaleTest:
* Builder#setLocale should normalize variants
* getISO3Language/Country should throw
MissingResourceException if language/country
is not empty and ICU.getISOLanguage/Country
fails to return non-empty string
* Added NPE throw for Builder#removeUnicodeLocaleAttribute
arguments
* openJdk Locale language can have 2 to 8
characters, not 2 to 3.

Bug: 26352408
Change-Id: Ice537112c3de31ad5fcb5de2c10be75fc012172d
ocale.java
fa9818c081c1c0158d80ddd9b1f92990b3e0eb30 06-Jan-2016 Narayan Kamath <narayan@google.com> Make Date.parse() a tad more lenient.

Support zone strings of the form GMT+04:30 in addition to
GMT+0430 and GMT+5. This fixes a couple of our URLConnectionTests
in cases where server was sending back dates in this format.

As a follow-up okhttp change, we should consider overriding
URLConnection#getHeaderFieldDate so that we can avoid using Date.parse
altogether.

bug: 26326992
Change-Id: Ia1198afb18f84874a9726e46c26d575ea9ff3f45
ate.java
78562a12977fc4d81cd31e7c5af05d66bb701ccd 05-Jan-2016 Narayan Kamath <narayan@google.com> Workaround bogus TreeMap Comparators.

Try our best not to compare elements against themselves.

**** THIS CHANGE WILL BE REVERTED IN A FUTURE ANDROID RELEASE ****

bug: 26336181
Change-Id: I67e846159c1be9e9a5595ece5a32a00ff8eacccd
reeMap.java
ed577c2762763a37eaafb287995ce0453cd2d5c9 04-Jan-2016 Yi Kong <yikong@google.com> Time zone ID should not use localized format

Bug: 26023953
Change-Id: I53f74587384ce6bb01ac14e868b84e2fdbb4f469
imeZone.java
7e2649e490f1da8c6c859a6c76d2199e1d9fb516 04-Jan-2016 Yi Kong <yikong@google.com> Check for leniency of calendar in getDisplayNames

and throw IllegalArgumentException if any of the calendar fields have
invalid values, as it is explicitly required by the Java spec.

Bug: 25998856
Change-Id: I66b9330ab2fc63bf56cb079705f6cf7c9dbb955e
alendar.java
5a65597bdfe80ca0a0940b0f5c429dece7328b38 30-Dec-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Revert "Re-enable libcore.java.util.LocaleTest"

This reverts commit e802cf54e3be8ef2fed0e84127a8398385ef8a11.

Change-Id: Ibefabe44d0421eead92e1882c0d5256ee6d597d8
ocale.java
e802cf54e3be8ef2fed0e84127a8398385ef8a11 30-Dec-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Re-enable libcore.java.util.LocaleTest

Remove side-effects from initDefault and make
it accessible from LocaleTest.

Bug: 26352408
Change-Id: Ia177a0ed505f9240521e1c46e1e49f215a14f03a
ocale.java
046bab7c9390cb2e697588fbf17808ac1d7cd3b1 23-Dec-2015 Shubham Ajmera <shubhamajmera@google.com> Merge "Fix CurrencyText#test_getSymbol"
ed7c218283783a62c3774fb548b0c08e3f9b5ea4 22-Dec-2015 Shubham Ajmera <shubhamajmera@google.com> Fix CurrencyText#test_getSymbol

Bug: 25997209
Change-Id: I4e290e902252c9d960c5788f858a9fcd8ae56d99
ocale.java
9777098f315536b148c5b921e0f3b41a6342b1dd 22-Dec-2015 Narayan Kamath <narayan@google.com> Merge "Remove unused non-java files under ojluni/src/main/java."
2c87ad3a45cecf9e344487cad1abfdebe79f2c7c 21-Dec-2015 Narayan Kamath <narayan@google.com> Update file headers.

Change-Id: I8149f41585768a1a4b72ab7bb4a1452376c05cc2
rrayList.java
rrays.java
alendar.java
ollections.java
urrency.java
ate.java
numMap.java
numSet.java
ormatter.java
regorianCalendar.java
ashMap.java
ashtable.java
inkedHashMap.java
ocale.java
roperties.java
esourceBundle.java
canner.java
erviceLoader.java
imeZone.java
reeMap.java
eakHashMap.java
MLUtils.java
ar/Attributes.java
ar/JarFile.java
ar/JarVerifier.java
ogging/FileHandler.java
ogging/LogManager.java
ogging/LogRecord.java
ogging/Logger.java
ogging/LoggingMXBean.java
ogging/MemoryHandler.java
ogging/SocketHandler.java
refs/AbstractPreferences.java
refs/FileSystemPreferences.java
refs/Preferences.java
refs/XmlSupport.java
egex/Matcher.java
egex/Pattern.java
ip/DeflaterInputStream.java
ip/DeflaterOutputStream.java
ip/Inflater.java
ip/InflaterInputStream.java
ip/ZipEntry.java
ip/ZipFile.java
ip/ZipInputStream.java
ip/ZipOutputStream.java
451b7279eddf4ffb0688e1c558d45b9f0d48d12d 21-Dec-2015 Narayan Kamath <narayan@google.com> Remove unused non-java files under ojluni/src/main/java.

The files that are meant to be included as resources are already
present in ojluni/src/resources/.

Change-Id: Icf5d9971daaec3dc2d02e92615ba3a7e92c59201
urrencyData.properties
cc42201b8d47d4c03a69dcf6df4e58c1a11d32e5 21-Dec-2015 Paul Duffin <paulduffin@google.com> Deleting unused or broken files

The tests removed from luni/src/test are testing files that no
longer exist. It's possible that they provided some coverage of
the code which is not provided for the OpenJDK code.

The classes removed from ojluni/src/main are the ones not
explicitly mentioned in the openjdk_java_files.mk.

Change-Id: Id52d65d9b1f06e1a6e7afbd93336c7d12e0c3083
apaneseImperialCalendar.java
oncurrent/AbstractExecutorService.java
oncurrent/ArrayBlockingQueue.java
oncurrent/BlockingDeque.java
oncurrent/BlockingQueue.java
oncurrent/BrokenBarrierException.java
oncurrent/Callable.java
oncurrent/CancellationException.java
oncurrent/CompletionService.java
oncurrent/ConcurrentHashMap.java
oncurrent/ConcurrentLinkedDeque.java
oncurrent/ConcurrentLinkedQueue.java
oncurrent/ConcurrentMap.java
oncurrent/ConcurrentNavigableMap.java
oncurrent/ConcurrentSkipListMap.java
oncurrent/ConcurrentSkipListSet.java
oncurrent/CopyOnWriteArrayList.java
oncurrent/CopyOnWriteArraySet.java
oncurrent/CountDownLatch.java
oncurrent/CyclicBarrier.java
oncurrent/DelayQueue.java
oncurrent/Delayed.java
oncurrent/Exchanger.java
oncurrent/ExecutionException.java
oncurrent/Executor.java
oncurrent/ExecutorCompletionService.java
oncurrent/ExecutorService.java
oncurrent/Executors.java
oncurrent/ForkJoinPool.java
oncurrent/ForkJoinTask.java
oncurrent/ForkJoinWorkerThread.java
oncurrent/Future.java
oncurrent/FutureTask.java
oncurrent/LinkedBlockingDeque.java
oncurrent/LinkedBlockingQueue.java
oncurrent/LinkedTransferQueue.java
oncurrent/Phaser.java
oncurrent/PriorityBlockingQueue.java
oncurrent/RecursiveAction.java
oncurrent/RecursiveTask.java
oncurrent/RejectedExecutionException.java
oncurrent/RejectedExecutionHandler.java
oncurrent/RunnableFuture.java
oncurrent/RunnableScheduledFuture.java
oncurrent/ScheduledExecutorService.java
oncurrent/ScheduledFuture.java
oncurrent/ScheduledThreadPoolExecutor.java
oncurrent/Semaphore.java
oncurrent/SynchronousQueue.java
oncurrent/ThreadFactory.java
oncurrent/ThreadLocalRandom.java
oncurrent/ThreadPoolExecutor.java
oncurrent/TimeUnit.java
oncurrent/TimeoutException.java
oncurrent/TransferQueue.java
oncurrent/atomic/AtomicBoolean.java
oncurrent/atomic/AtomicInteger.java
oncurrent/atomic/AtomicIntegerArray.java
oncurrent/atomic/AtomicIntegerFieldUpdater.java
oncurrent/atomic/AtomicLong.java
oncurrent/atomic/AtomicLongArray.java
oncurrent/atomic/AtomicLongFieldUpdater.java
oncurrent/atomic/AtomicMarkableReference.java
oncurrent/atomic/AtomicReference.java
oncurrent/atomic/AtomicReferenceArray.java
oncurrent/atomic/AtomicReferenceFieldUpdater.java
oncurrent/atomic/AtomicStampedReference.java
oncurrent/atomic/package-info.java
oncurrent/locks/AbstractOwnableSynchronizer.java
oncurrent/locks/AbstractQueuedLongSynchronizer.java
oncurrent/locks/AbstractQueuedSynchronizer.java
oncurrent/locks/Condition.java
oncurrent/locks/Lock.java
oncurrent/locks/LockSupport.java
oncurrent/locks/ReadWriteLock.java
oncurrent/locks/ReentrantLock.java
oncurrent/locks/ReentrantReadWriteLock.java
oncurrent/locks/package-info.java
oncurrent/package-info.java
ar/JavaUtilJarAccessImpl.java
egex/ASCII.java
egex/UnicodeProp.java
85d69e16fe1e59e50c1ad228e754abf325088362 20-Dec-2015 Narayan Kamath <narayan@google.com> Revert "Revert "Port ICU based regex implementation over to OpenJdk.""

This reverts commit fadaa97dd78736d94460684d87dcdadd14a5813c.

Fixes build breakage due to unresolved @link tags.

Change-Id: I329c28d872a2a40064b7219d3537eaae1cfe6fae
egex/Matcher.java
egex/Pattern.java
fadaa97dd78736d94460684d87dcdadd14a5813c 18-Dec-2015 Brian Carlstrom <bdc@google.com> Revert "Port ICU based regex implementation over to OpenJdk."

This reverts commit 075cf9ab88476958db0dd3ca80e21802fc623f66.

Change-Id: If343ef8a2f62b1ce301f1801b1660cfb21552178
egex/Matcher.java
egex/Pattern.java
075cf9ab88476958db0dd3ca80e21802fc623f66 18-Dec-2015 Narayan Kamath <narayan@google.com> Port ICU based regex implementation over to OpenJdk.

Change-Id: I5de7fa40dbf35843949ac3eb9d7cef680d64e45a
egex/Matcher.java
egex/Pattern.java
e4297a336474b427ffc1044d822c9114dd8f58fd 12-Dec-2015 Narayan Kamath <narayan@google.com> Simplify AbstractPreferences.

There's no need for a complicated re-implementation of copy
on write lists. Simple ArrayLists will suffice; all operations
are guarded by |lock| and we can return a copy of the list to
the Event processor thread to avoid concurrent modification of
the list while that thread is dispatching events.

Fixes various preference tests related to adding / removing
duplicate listeners.

A notable difference in behaviour here is that listeners are
now compared using their equals() method and not using reference
equality.

bug: 26023763
bug: 25996530

Change-Id: I57ee723cf926786e1f119ec1e7740c66162ab749
refs/AbstractPreferences.java
d54f347c87caee04384ab8282bab5553e9361493 11-Dec-2015 Narayan Kamath <narayan@google.com> Adopt a slightly more liberal definition of whitespace in props file.

Use Character.isWhiteSpace. Fixes PropertiesTest.

bug: 25998006
Change-Id: Ifea0a7d1d3a3e04290b427c331b33c303e28e401
roperties.java
f8382ed614d5e2bc3056db92d57459ca0564c7cc 11-Dec-2015 Narayan Kamath <narayan@google.com> Fix ServiceLoaderTest.

By providing appropriate "cause"s to the exceptions we throw.

bug: 26023474
Change-Id: I0856d9a90012f3dad0b4d34248f95a0d8ca0edf3
erviceLoader.java
5df3cb8454198b6c2a8256fc54283206b9813d08 09-Dec-2015 Narayan Kamath <narayan@google.com> Apply NetworkSecurityPolicies to FtpURLConnection / SocketHandler.

Based on change 2f4d25190a7d2cc8328a202417ca9077a02e6d9a.

bug: 25923638
Change-Id: I9fbb8b418a0f9bf4c2d7957a554e49b694bdf105
ogging/SocketHandler.java
9820e5b27a8ac4ea426f8e3cddf06445a9e02840 08-Dec-2015 Yi Kong <yikong@google.com> Rewrite util.format for better performance

OpenJDK uses regular expression to parse the format specifier, which
is expensive both to compile and to execute. Rewriting to manually
parse the specifier reduces formatter benchmark execution time by 45%.

=== Angler a57@1.4GHz ===
benchmark Orig Mod
_Formatter_large 69300 37402
_Formatter_medium 70116 39899
_Formatter_small 68791 37501

Bug: 25887112
Change-Id: I71a94d81c8d8228696c4ca02e60d58552886eaae
ormatter.java
6e8e72415d6729c9f1de51d1ce5090438002ae3b 08-Dec-2015 Narayan Kamath <narayan@google.com> Sort fails with ArrayIndexOutOfBoundsException

cherry-picked from jdk8.

HG changeset patch:
User rriggs
Date 1377531965 14400
Mon Aug 26 11:46:05 2013 -0400
Node ID 07585a2483fa6dbe3c3ed91108b8bd5c1eeddee6
Parent 8a36fc7f494c47fb641ba74b09fae4f6655a7399
8011944: Sort fails with ArrayIndexOutOfBoundsException
Summary: Increase the size of pending stack and add test cases
Reviewed-by: alanb

bug: 26022882
Change-Id: I4b86f9e9222b91cfafebb6af6cb1a027713e4e58
omparableTimSort.java
imSort.java
e8e4da2f84da30bbc11a63b7a87a153f62b1ce65 27-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Remove StrictJarFile from ClassPathURLStreamHandler

StrictJarFile was moved from libcore to framework/base
(licensing reasons) and in no longer accessible in
the ClassPathURLStreamHandler. I replaced it using
JarFile class.

+ ZipFile compatibility fix, openjdk ZipFile#getInputStream
was not fine with directory entries without "/" suffix (returning null),
fixed a flag to deal with them like in previous impl.

Bug: 25337946
Change-Id: I9832b34664bd331a96cd06aabb4cbf834c58f208
ip/ZipFile.java
b10b2a3ab693cfd6156d06ffe4e00ce69b9c9194 26-Nov-2015 Narayan Kamath <narayan@google.com> Fix ConcurrentModificationException in ArrayList iterators.

OpenJdk's hasNext() implementation always checks the current size
of the list so it's possible for this function to return "false"
and then "true" if an element is subsequently added. Attempting to
iterate over that element will throw a ConcurrentModificationException.

The unit-test demonstrates the sequence of operations applications
were performing, usually from a (for : each) loop of listeners where the
last listener would add stuff to the list.

bug: 25867131
bug: 25867396
bug: 25866843
bug: 25866828

Change-Id: I785a3a44aba22e6872b9471551011f0dd28458de
rrayList.java
5339965fe0440cb3f203c09ef5eacaf262ae1d13 25-Nov-2015 Narayan Kamath <narayan@google.com> Stop calling Math.min from HashMap.inflateTable.

Fixes 119-noimage-patchoat on host. Note that this partially
brings back the change that was reverted in 4ee97ca40af11f4fc.
The rest of that change was still super bogus because we'd always
scale capacity with loadFactor, which is wrong.

bug: 25837641

Change-Id: Ifc3ab50e67035517a12bcb70177553130867e326
ashMap.java
4ee97ca40af11f4fc9dc9e381a0730513ed026ab 24-Nov-2015 Narayan Kamath <narayan@google.com> Fix HashMapTest#testSerializationSelf.

Reverts a bogus change to the map capacity calculation.

bug: 25837641
Change-Id: Id2081ce845e459f8f87578921b6bd113ceb049a6
ashMap.java
70b617fe562806bc3e15452a2792fec4355bd54f 20-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge mnc-dr-enso-dev into master

OpenJDK adjustments for master.
- Restored removed libcore.icu.* classes (needed
by the openjdk java.text.* classes). This will be
undone in short future.
- Adjusted java.lang.* and java.lang.reflect.* classes
for native reflection and other changes in master.

Bug: 25758743
Change-Id: Ifbbe5b1e8661138fc32ad24127f76f711dd585b7
f43ff684470cafe6819b1df7461ee83322f27af8 19-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Rename Entry class in TreeMap" into lmp-mr1-enso-dev
am: a5c16db453

* commit 'a5c16db453098d7ab945edd379a2d52a1465682b':
Rename Entry class in TreeMap
1dfccfcdeeeab96f01013cf9103d32b4f68b2e64 18-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Rename Entry class in TreeMap

The name "Entry" was hiding interface Map.Entry so code
that did stuff like :

TreeMap.Entry<K, V> foo : map.entrySet()

would break. Moreover, that naming scheme confusing (with
interface Map.Entry, class TreeMap.Entry) and this change
(IMO) improves readability

Change-Id: Ieb9d8c40f2d354dc8a66daf1649946168aa35831
reeMap.java
b756b485cb5d1d3110f17f91ed896e5bedbac899 18-Nov-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Merge "Rename Entry classes in HashMap and LinkedHashMap." into lmp-mr1-enso-dev
am: 1a89b997a4

* commit '1a89b997a4a9cb45be4cfa3a626a442f0b3a3f51':
Rename Entry classes in HashMap and LinkedHashMap.
9048c4faf8f9f15e0124c32834b6a9a2a6cb54de 10-Nov-2015 Narayan Kamath <narayan@google.com> Rename Entry classes in HashMap and LinkedHashMap.

The name "Entry" was hiding interface Map.Entry so code
that did stuff like :

HashMap.Entry<K, V> foo : map.entrySet()

would break. Moreover, that naming scheme confusing (with
interface Map.Entry, class HashMap.Entry and class
LinkedHashMap.Entry) and this change (IMO) improves readability.

Change-Id: Ie9ea96f9a8e4a4988bdc47f77117dc23922315b3
ashMap.java
inkedHashMap.java
92ac90f13cae6440eedd87085a43c3c8e58ddf9d 28-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Rename generic type parameter.

The difference causes a bogus build breakage because doclava can't
deal with the change.

Change-Id: Icddc4f39c062ee107df0ef053a8ac5cad8f54f45
ollections.java
1a9ca631d5e2d44f39b556132af3a3cb4e34a966 28-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Update StrictJarFile.

Also add a hidden ZipEntry constructor that this code expects.

Change-Id: I30c437b016bbbfcebe5a81bad4af3b31ee2317f3
ip/ZipEntry.java
bfb2104abe17ff11c4ec474af12fc7543e881f40 14-Oct-2015 Narayan Kamath <narayan@google.com> Collections: Remove bogus test-case and optimize sort.

As inconsistent as it might sound, ArrayList modCounts are not
incremented during #set (and by extension #sort).

While we're here, also add a zero-copy path for sorting an arraylist,
where we can directly sort the underlying array.

(cherry picked from commit 4df84db413a76f7aac059942e34934a9d4ae6373)

Change-Id: I6588ecdb6555bb39a441e1bb8368825de7029385
rrayList.java
ollections.java
669c2cc344614fd721cfff2e7a9e80ad6e8b368c 07-Oct-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Speed up Arrays#deepHashCode & deepEquals

Getting class object and comparing it performs
faster than instanceof operator.

Change-Id: I026ad4b2bb06de8325df82fc21ced2e1d7d49b21
rrays.java
3be987f0f18648b3c532c8b89d09505e18594241 06-Oct-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Inline ArrayList rangeCheck&elementData methods

This greatly enhances ArrayList performance.

Change-Id: Idb64ed546eea1d0f417839f4f486302ff39037df
rrayList.java
247cc3a945f42b9dfc775b6d88512b43b6bc8e5b 11-Sep-2015 Narayan Kamath <narayan@google.com> Locale : Use ICU data for 2->3 letter mappings.

.. and also for lists of countries and languages.

Change-Id: I0d1c0cfd1d54137c29272dda3ebabe0379ca4ef6
ocale.java
ocaleISOData.java
e9ddd4b195431602cb5473d47d540d9b740e68e3 03-Sep-2015 Narayan Kamath <narayan@google.com> Remove default pack200 packers and unpackers.

Change-Id: I42745ca7db6f9025fe91f9437278e218751f88c5
ar/Pack200.java
8dd7ce3e7ee13c49c8483f8a931747ab247fb573 21-Aug-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix ZipInputStream#available()

ZipInputStream#available() will return 0 if there's
no more bytes to read in deflated file.

Fixes ZipInputStreamTest#test_available

Change-Id: Ic8b2dc1d042e8ce2c4f98c60beff9617adec2b02
ip/ZipInputStream.java
d4f87eb09746acbeaf5321c000306ac994f32836 19-Aug-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix for ZipOutputStreamTest#testCreateEmpty

Change-Id: I90141c5a7f5ec72b33b362cfcc00d426f11a9df0
ip/ZipOutputStream.java
adbb22cb1c38fcb6160276fa2739a46b0ce516c3 19-Aug-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix DeflaterOutputStreamTest#testSyncFlushDeflater

Based on https://googleplex-android-review.git.corp.google.com/#/c/102108

Change-Id: I78fefa10929d58c4947abed5af815c10b89db02c
ip/DeflaterOutputStream.java
ca75bfe6227f87574be3df170643ead89ac880f9 13-Aug-2015 Narayan Kamath <narayan@google.com> More Preferences fixes.

- Make sure the xxRootModFiles exist.
- Fix a test that assumes the implementation creates directories
eagerly.

Change-Id: Ic5cdf9a7f19af5ac66858046615772ab37cf5c3d
refs/FileSystemPreferences.java
96b40e87c32023084d7153360b1fa0c44c598095 12-Aug-2015 Narayan Kamath <narayan@google.com> Stop using libcore's java.util.prefs implementation.

Change-Id: If30217f18b124871ff43a39b0fb7a55bd06f095b
refs/FileSystemPreferences.java
refs/Preferences.java
refs/XmlSupport.java
e9cf8b104314c1635f643d69ff654ed31901cb25 10-Aug-2015 Narayan Kamath <narayan@google.com> Fix Properties tests.

- Don't use a validating builder (not supported).
- Be more tolerant of CDATA nodes in input XML.

Change-Id: I08e0ea160a3e035f5cf6ba5cba189a75b32b49e7
MLUtils.java
9c17d0241b1b974e5379949df2ff881d0fff3ef4 07-Aug-2015 Narayan Kamath <narayan@google.com> Throw IOException on all stream operations on closed ZipFiles.

Change-Id: I0ade0cd2fab28203c0f0a78978ce1db46cdb3f5d
ip/ZipFile.java
a68b1a5ba82ef8cc19aafdce7d9c7f9631943f84 07-Aug-2015 Narayan Kamath <narayan@google.com> Throw AIOOBE when toIndex < fromIndex.

As documented.

Change-Id: I869ac01136fc64c59fc881f8b094d7dc5a8c430d
rrayList.java
88218876129da6f91f4c8a637c2d2c5a223795c1 07-Aug-2015 Narayan Kamath <narayan@google.com> Fix Date#getTimeZoneOffset.

There's no need to negate and convert to minutes twice. (WTF ??!!).

Change-Id: I1d0eaeb4d31fcbb32f1cc92d8e606e69834239d6
ate.java
b3c5785d4f83fe0ce0bfa91f04e7cc0989e93142 07-Aug-2015 Narayan Kamath <narayan@google.com> Throw ISE on closed inflaters.

Change-Id: I17de85b7230f36d0437d5e1f3ab4508bcac895f0
ip/Inflater.java
6dddb4c2136efba05ffc06f34e6bfed51c9f8ea1 07-Aug-2015 Narayan Kamath <narayan@google.com> Throw IOException on closed JarVerifier.VerifierStreams.

Throwing an NPE seems odd, to say the least and is inconsistent
with other streams returned from JarFile.getInputStream.

Change-Id: If2e256680fe5ebeab1308f744c7076e7fa8fa459
ar/JarVerifier.java
35b9ace5413a5198f13e73763e0d1b693361c104 07-Aug-2015 Narayan Kamath <narayan@google.com> Improve InflaterInputStream#available.

Eagerly set eof depending on the inflater state.

Change-Id: Ib89f86d88353027c144bd85ae0c0c5b8af2399fa
ip/InflaterInputStream.java
457d3b26a6cbd62d203d3b56f69bcc441ea8d66f 07-Aug-2015 Narayan Kamath <narayan@google.com> Improve DeflaterInputStream#available.

We set reachEOF as soon as def.finished() == true.

Change-Id: Ib843221c1b029de577f7399c5e1ff89b1279824d
ip/DeflaterInputStream.java
8b2e919af0d25fc0a05f05cd9d1286fdf5b3b68c 06-Aug-2015 Narayan Kamath <narayan@google.com> Fix several Scanner issues.

- Update the Matcher properly.
- Support \u221E for infinity.
- Support non-decimal starting digits.
- Update test to remove some bogus assertions.

Change-Id: Ie7c57019dea49c441bed35d9a6814ec040a96de0
canner.java
b4105e7f1e3ab24131976f68be4554e694a0e1d4 05-Aug-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> org.apache.harmony.tests.java.util.TreeMapTest fix

- Different exception (NPE instead of CCE) thrown in one error condition
- Fixed (tail|head)Map map edge condition handling.

Change-Id: I341584f162c85b380a0ee6907101f433d306bf84
reeMap.java
4cb7ea3b1ec96f3cb678c63d388106dffab9e4ba 31-Jul-2015 Narayan Kamath <narayan@google.com> Fix host runtimes.

Needs data for j.u.Currency.

Change-Id: I23728bb5b2c8d68079c04e984f66afb96097973c
urrency.java
8f12848784d4954d633848ac60d12a91401ddecd 28-Jul-2015 Narayan Kamath <narayan@google.com> Revert android patch to make {Linked}HashMap.Entry public.

It's unnecessary and only serves to break code that writes things
like :

HashMap.Entry<K, V> foo = bar.entrySet();

Change-Id: I35efd90b3f53fd3c843f076f4e9e1fa5a171ff05
ashMap.java
inkedHashMap.java
9e78cee3f3edf84254174717f475605d712aad1c 27-Jul-2015 Narayan Kamath <narayan@google.com> Various fixes to get the docs build compiling properly.

- Make sure javadoc @param tags and function arguments match.
- All @deprecated tags must have a description.
- Include missing files from java.nio.file.

Change-Id: Iafa324cbe0604a9d4cf96b00fea49c6516b30915
ate.java
canner.java
imeZone.java
ar/JarVerifier.java
00bdcb8238d4d4172e49572cbb23927836ded7ae 27-Jul-2015 Narayan Kamath <narayan@google.com> Fix javadoc for java.util.logging.*

Remove references to java.lang.management.*

Change-Id: I2ce141c1b3e6b800b4aeeb1f77022d4a0d58990d
ogging/LogManager.java
ogging/LoggingMXBean.java
3ecf5a6acea7b312ca410f52ac5b1e993ba710c9 13-Jul-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> java.util.zip.Adler32 native code

Change-Id: If109b6bd8869548132c21686ebf55df107ea7ec2
ip/Adler32.java
46e3649f898305d185fc40bae2542e933a16b619 06-May-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of java.lang.* [part 1]

- Changes to String hashing.
- Change StringCoding.isTrusted.
- For boxed primitive types, change how TYPE is derived (use the
array equivalents component type).
- System: the security manager is now always null. Also, port over
changes to make system properties read only.
- StrictMath : Use our existing fdlibm and remove references to
jdflibm.h.

Change-Id: I221692836b9320cade9074b122fbc25c8e72cf99
ashMap.java
f7ab2bc37debba91864bfec6572a3e7bbe994c58 06-May-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of java.net.*

- Add FileURLConnection.
- NetworkUtilities : Update field names in JNI.
- Suppress a few libcore tests that rely on internal implementation
details.
- Remove code that loads the net library (not needed on android).
- DatagramSocket : Add setNetworkInterface method.
- HttpCookie : make parse & field public
- Inet4Address / Inet6Address : Add getAddressInternal.
- InetAddress : Add methods required by frameworks/base, particularly
those required to deal with net-ids and scope ids.
- URI : Add UriCodec static members for AUTHORITY_ENCODER and friends.
- URL : Add toUriLenient
- URLStreamHandler : Add a toExternalForm variant that optionally
escapes illegal chars.
- Inet4AddressImpl.c : Unconditionally define HAS_GLIBC_GETHOSTBY_R

Change-Id: Ic51f863941f5d954ed6cf86309cc610e711d54bd
ar/JarFile.java
ip/ZipFile.java
05f3b6342e5375c8994e1d54c3f588e09ef21854 05-May-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of java.lang.reflect.*

- Remove unused (and currently unimplemented by the runtime) code
from sun.reflect.Reflection
- Array: Move most methods to managed code, use Art's newMultiArray
method.
- Constructor / Field / Method : Delegate to ArtField / ArtMethod
etc.

Change-Id: Ia8bcbd902ed7dd3b50675a266db9732b95427fb6
eakHashMap.java
1ae149ae8db46adac5723c739d53dd82a1cf2e1a 27-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of java.io.*

(except for DateInputStream, RandomAccessFile, File*, Object*)

- Make Shutdown public (for use without shared secrets).
- Add Console.getConsole()
- Remove legacy merge sort support from Arrays.
- Remove ensureMemberAccess from ReflectUtil.

Change-Id: I0a815ddcfac83af09698dc4ce8c88b920a844ffa
rrays.java
983b2c6ff9ea6d35adf7ab6398dccf870b7e180a 24-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation for java.util.*

- Add a target for currency data (currency.data).
- Arrays: Add an android specific debugging method.
- Currency: Use ICU4C data.
- EnumMap / EnumSet : Use JavaLangAccess directly.
- HashMap / Hashtable / LinkedHashMap : Make Entry<K,V> public.
- LinkedHashMap : Add an eldest() method.
- Locale : Fix handling of 3 letter region codes.
- Scanner : Temporarily remove references to the nio file APIs.
- ServiceLoader : Add a method to instantiate a class from a system
property (used in other parts of libcore).
- Hashing : Use JavaLangAccess directly.
- VM : Remove native initialization (doesn't apply here).

Change-Id: I8e870357cf3987cd571c7ebe8bc633a85380a8d5
rrays.java
urrency.java
numMap.java
numSet.java
ashMap.java
ashtable.java
inkedHashMap.java
ocale.java
canner.java
erviceLoader.java
adc40417389a57bc7a831f55334bffcc07343eb9 21-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Fix unit tests from java.util.{zip, logging, prefs}.*

- zip64 is now supported.
- LogManager: use getResourceAsStream for logging.properties.
- MemoryHandler : use context classloader for loading properties.
- ZipEntry : Explicitly use UTF-8 for names and comments.

- ZipFile :
- Error out early if the file is too short..
- .. or if the file has zero zip entries.
- .. or if the file has two entries with the same name.
- .. or if any the entries have a C string terminator in their name.

Change-Id: Ie0cdb3d9dd5f12181507b20fc239bba3b2b9b374
ogging/LogManager.java
ogging/MemoryHandler.java
refs/Preferences.java
ip/ZipEntry.java
ip/ZipFile.java
a8ed084745590c5e4a0e8559b5821809d60fe242 21-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of java.util.zip.*

- Move some of the internal implementation details of libcore's
zipfile into StrictJarFile.
- TODO: Adler32 continues to use old native code from libcore, this
must be switched over.
- InflaterInputStream: |closed| becomes protected.
- ZipFile : Always use mmap.
- ZipEntry : Add a long dataOffset.
- Switch all native code over to explicit registration.

Change-Id: Id5519b4548ea1eb22fd182edfbd2c804dc6f3bb5
ip/Adler32.java
ip/InflaterInputStream.java
ip/ZipEntry.java
ip/ZipFile.java
2683a45f92104cafe8acaf18e7211c67324a0fe6 20-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of java.util.prefs.*

Change-Id: I4336215159fbfff62269be7cf6f51b5e38adfb36
refs/Preferences.java
47f3c98d3c706c02c898cd15fbe6ee19d840c2c6 20-Apr-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of java.util.logging.*

- Use VMStack instead of Reflection wherever possible.
- Remove special handling of setuid programs.

Change-Id: I34c895e4598643ccbd9281b0316b82853a302c98
ogging/FileHandler.java
ogging/LogManager.java
ogging/LogRecord.java
ogging/Logger.java
1d958dba8b5c9589e3375446045e1672eee0e1b1 24-Feb-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementation of parts of java.util.*, java.security.*.

Includes:

- java.util.jar
- java.security
- java.security.acl,
- java.security.cert
- java.security.interfaces
- java.security.spec

Preserve StrictJarFile (and supporting classes) which confirms to a
stronger spec than java.util.jar.*

- StrictJarFileTest#testGetManifest has been temporarily suppressed.
- Several security related methods are no-ops now.
- Read security.properties from the library jar file (and not the FS).
- Security.initializeStatics uses the following providers (in order):
(a) conscrypt
(b) bouncycastle
(c) harmony's crypto provider.
(d) conscrypt (JSSE).

Change-Id: I24d3d68b033d00293c3e450429d31cb8ce50a44b
ar/Attributes.java
ar/JarFile.java
9c853c5b9ebbb0ef60a013ae10ee411d70dfa832 18-Feb-2015 Piotr Jastrzebski <haaawk@google.com> Use OpenJdk implementations of java.text.*

- LocaleInternalsTest has been disabled since it depends on
internal implementation details.
- Collator: Use libcore's RuleBasedCollatorICU to fetch collator
rules instead of sun.misc.resources.LocaleData & friends.
- DateFormat: Add support for set24HourTimePref (not wired up
yet).
- DateFormatSymbols : Use libcore's LocaleData & TimeZoneNames
classes internally.
- NumberFormat: Use libcore's LocaleData.
- Drop support for SCIENTIFICSTYLE (we should re-enable this at
some point ?).
- SimpleDateFormat : Don't reject the format specifiers for
standalone weekday and friends. We'll need to switch over to
using ICU4J formatters at some point.
- Calendar : Use GregorianCalendar only.
- TimeZone : Use TimeZoneNames to access time zone names.

Change-Id: I4a2866904d4f2f39f0793154d9aad7f109da3b5a
alendar.java
ate.java
regorianCalendar.java
apaneseImperialCalendar.java
ocale.java
esourceBundle.java
imeZone.java
51b1b6997fd3f980076b8081f7f1165ccc2a4008 16-Feb-2015 Piotr Jastrzebski <haaawk@google.com> Initial import of OpenJdk files.

Create new libcore/ojluni directory with src/main/java and
src/main/native subdirectiories.

Build ojluni into core-oj jar.

Use openjdk classes from java.awt.font package.

Copy all files from jdk/src/share/classes and jdk/src/solaris/classes
directories in openjdk into libcore/ojluni/src/main/java.

Copy following native files from openjdk to
libcore/ojluni/src/main/native:
jdk/src/solaris/native/java/io/canonicalize_md.c
build/linux-amd64/include/classfile_constants.h
jdk/src/share/native/java/net/DatagramPacket.c
jdk/src/solaris/native/sun/net/spi/DefaultProxySelector.c
jdk/src/share/native/java/lang/Double.c
jdk/src/share/native/java/lang/fdlibm/include/fdlibm.h
jdk/src/solaris/native/sun/nio/ch/FileChannelImpl.c
jdk/src/solaris/native/java/io/FileDescriptor_md.c
jdk/src/solaris/native/sun/nio/ch/FileDispatcherImpl.c
jdk/src/share/native/java/io/FileInputStream.c
jdk/src/solaris/native/sun/nio/ch/FileKey.c
jdk/src/solaris/native/java/io/FileOutputStream_md.c
jdk/src/solaris/native/java/io/FileSystem_md.c
jdk/src/share/native/java/lang/Float.c
jdk/src/share/native/java/net/Inet4Address.c
jdk/src/solaris/native/java/net/Inet4AddressImpl.c
jdk/src/share/native/java/net/Inet6Address.c
jdk/src/solaris/native/java/net/Inet6AddressImpl.c
jdk/src/share/native/java/net/InetAddress.c
jdk/src/solaris/native/java/net/InetAddressImplFactory.c
jdk/src/share/native/java/io/io_util.c
jdk/src/solaris/native/sun/nio/ch/IOUtil.c
jdk/src/share/native/java/io/io_util.h
jdk/src/solaris/native/java/io/io_util_md.c
jdk/src/solaris/native/java/io/io_util_md.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/java_io_FileDescriptor.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileInputStream.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileOutputStream.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_FileSystem.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_ObjectStreamClass.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_io_UnixFileSystem.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Double.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Float.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Integer.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Long.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Runtime.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Shutdown.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_StrictMath.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_String.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_System.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Thread.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/java_lang_Throwable.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_DatagramPacket.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet4Address.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet4AddressImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet6Address.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_Inet6AddressImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_InetAddress.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_InetAddressImplFactory.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_NetworkInterface.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_PlainDatagramSocketImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_PlainSocketImpl.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketInputStream.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketOptions.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/java_net_SocketOutputStream.h
jdk/src/share/native/java/lang/java_props.h
jdk/src/solaris/native/java/lang/java_props_md.c
jdk/src/share/native/java/util/zip/Adler32.c as java_util_zip_Adler32.c
jdk/src/share/native/java/util/zip/CRC32.c as java_util_zip_CRC32.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_CRC32.h
jdk/src/share/native/java/util/zip/Deflater.c as java_util_zip_Deflater.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_Deflater.h
jdk/src/share/native/java/util/zip/Inflater.c as java_util_zip_Inflater.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_Inflater.h
jdk/src/share/native/java/util/zip/ZipFile.c as java_util_zip_ZipFile.c
build/linux-amd64/tmp/sun/java.util.zip/zip/CClassHeaders/java_util_zip_ZipFile.h
jdk/src/share/native/java/lang/fdlibm/include/jfdlibm.h
jdk/src/share/native/common/jlong.h
jdk/src/solaris/native/common/jlong_md.h
jdk/src/share/native/common/jni_util.c
jdk/src/share/native/common/jni_util.h
jdk/src/solaris/native/common/jni_util_md.c
jdk/src/share/javavm/export/jvm.h
jdk/src/solaris/javavm/export/jvm_md.h
jdk/src/solaris/native/java/net/linux_close.c
jdk/src/share/native/sun/misc/NativeSignalHandler.c
jdk/src/solaris/native/sun/nio/ch/NativeThread.c
jdk/src/share/native/java/net/net_util.c
jdk/src/share/native/java/net/net_util.h
jdk/src/solaris/native/java/net/net_util_md.c
jdk/src/solaris/native/java/net/net_util_md.h
jdk/src/solaris/native/java/net/NetworkInterface.c
jdk/src/share/native/sun/nio/ch/nio.h
jdk/src/solaris/native/sun/nio/ch/nio_util.h
jdk/src/share/native/java/io/ObjectStreamClass.c
jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
jdk/src/solaris/native/java/net/PlainSocketImpl.c
jdk/src/solaris/native/java/lang/ProcessEnvironment_md.c
jdk/src/share/native/java/lang/Runtime.c
jdk/src/share/native/java/lang/Shutdown.c
jdk/src/share/native/sun/misc/Signal.c
jdk/src/solaris/native/java/net/SocketInputStream.c
jdk/src/solaris/native/java/net/SocketOutputStream.c
jdk/src/share/native/java/lang/StrictMath.c
jdk/src/share/native/java/lang/String.c
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/sun_misc_NativeSignalHandler.h
build/linux-amd64/tmp/java/java.lang/java/CClassHeaders/sun_misc_Signal.h
build/linux-amd64/tmp/sun/java.net/net/CClassHeaders/sun_net_spi_DefaultProxySelector.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileChannelImpl.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileDispatcherImpl.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_FileKey.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_IOStatus.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_IOUtil.h
build/linux-amd64/tmp/java/java.nio/nio/CClassHeaders/sun_nio_ch_NativeThread.h
jdk/src/share/native/java/lang/System.c
jdk/src/share/native/java/lang/Thread.c
jdk/src/share/native/java/lang/Throwable.c
jdk/src/solaris/native/java/io/UnixFileSystem_md.c
jdk/src/solaris/native/java/lang/UNIXProcess_md.c
jdk/src/share/native/java/util/zip/zip_util.c
jdk/src/share/native/java/util/zip/zip_util.h

Change-Id: Ib237df4e1b7b5b4d9f12e74d189e6ec9eed3c31d
bstractCollection.java
bstractList.java
bstractMap.java
bstractQueue.java
bstractSequentialList.java
bstractSet.java
rrayDeque.java
rrayList.java
rrays.java
itSet.java
alendar.java
ollection.java
ollections.java
omparableTimSort.java
omparator.java
oncurrentModificationException.java
urrency.java
urrencyData.properties
ate.java
eque.java
ictionary.java
ualPivotQuicksort.java
uplicateFormatFlagsException.java
mptyStackException.java
numMap.java
numSet.java
numeration.java
ventListener.java
ventListenerProxy.java
ventObject.java
ormatFlagsConversionMismatchException.java
ormattable.java
ormattableFlags.java
ormatter.java
ormatterClosedException.java
regorianCalendar.java
ashMap.java
ashSet.java
ashtable.java
dentityHashMap.java
llegalFormatCodePointException.java
llegalFormatConversionException.java
llegalFormatException.java
llegalFormatFlagsException.java
llegalFormatPrecisionException.java
llegalFormatWidthException.java
llformedLocaleException.java
nputMismatchException.java
nvalidPropertiesFormatException.java
terator.java
apaneseImperialCalendar.java
umboEnumSet.java
inkedHashMap.java
inkedHashSet.java
inkedList.java
ist.java
istIterator.java
istResourceBundle.java
ocale.java
ocaleISOData.java
ap.java
issingFormatArgumentException.java
issingFormatWidthException.java
issingResourceException.java
avigableMap.java
avigableSet.java
oSuchElementException.java
bjects.java
bservable.java
bserver.java
riorityQueue.java
roperties.java
ropertyPermission.java
ropertyResourceBundle.java
ueue.java
andom.java
andomAccess.java
egularEnumSet.java
esourceBundle.java
canner.java
erviceConfigurationError.java
erviceLoader.java
et.java
impleTimeZone.java
ortedMap.java
ortedSet.java
tack.java
tringTokenizer.java
imSort.java
imeZone.java
imer.java
imerTask.java
ooManyListenersException.java
reeMap.java
reeSet.java
UID.java
nknownFormatConversionException.java
nknownFormatFlagsException.java
ector.java
eakHashMap.java
MLUtils.java
oncurrent/AbstractExecutorService.java
oncurrent/ArrayBlockingQueue.java
oncurrent/BlockingDeque.java
oncurrent/BlockingQueue.java
oncurrent/BrokenBarrierException.java
oncurrent/Callable.java
oncurrent/CancellationException.java
oncurrent/CompletionService.java
oncurrent/ConcurrentHashMap.java
oncurrent/ConcurrentLinkedDeque.java
oncurrent/ConcurrentLinkedQueue.java
oncurrent/ConcurrentMap.java
oncurrent/ConcurrentNavigableMap.java
oncurrent/ConcurrentSkipListMap.java
oncurrent/ConcurrentSkipListSet.java
oncurrent/CopyOnWriteArrayList.java
oncurrent/CopyOnWriteArraySet.java
oncurrent/CountDownLatch.java
oncurrent/CyclicBarrier.java
oncurrent/DelayQueue.java
oncurrent/Delayed.java
oncurrent/Exchanger.java
oncurrent/ExecutionException.java
oncurrent/Executor.java
oncurrent/ExecutorCompletionService.java
oncurrent/ExecutorService.java
oncurrent/Executors.java
oncurrent/ForkJoinPool.java
oncurrent/ForkJoinTask.java
oncurrent/ForkJoinWorkerThread.java
oncurrent/Future.java
oncurrent/FutureTask.java
oncurrent/LinkedBlockingDeque.java
oncurrent/LinkedBlockingQueue.java
oncurrent/LinkedTransferQueue.java
oncurrent/Phaser.java
oncurrent/PriorityBlockingQueue.java
oncurrent/RecursiveAction.java
oncurrent/RecursiveTask.java
oncurrent/RejectedExecutionException.java
oncurrent/RejectedExecutionHandler.java
oncurrent/RunnableFuture.java
oncurrent/RunnableScheduledFuture.java
oncurrent/ScheduledExecutorService.java
oncurrent/ScheduledFuture.java
oncurrent/ScheduledThreadPoolExecutor.java
oncurrent/Semaphore.java
oncurrent/SynchronousQueue.java
oncurrent/ThreadFactory.java
oncurrent/ThreadLocalRandom.java
oncurrent/ThreadPoolExecutor.java
oncurrent/TimeUnit.java
oncurrent/TimeoutException.java
oncurrent/TransferQueue.java
oncurrent/atomic/AtomicBoolean.java
oncurrent/atomic/AtomicInteger.java
oncurrent/atomic/AtomicIntegerArray.java
oncurrent/atomic/AtomicIntegerFieldUpdater.java
oncurrent/atomic/AtomicLong.java
oncurrent/atomic/AtomicLongArray.java
oncurrent/atomic/AtomicLongFieldUpdater.java
oncurrent/atomic/AtomicMarkableReference.java
oncurrent/atomic/AtomicReference.java
oncurrent/atomic/AtomicReferenceArray.java
oncurrent/atomic/AtomicReferenceFieldUpdater.java
oncurrent/atomic/AtomicStampedReference.java
oncurrent/atomic/package-info.java
oncurrent/locks/AbstractOwnableSynchronizer.java
oncurrent/locks/AbstractQueuedLongSynchronizer.java
oncurrent/locks/AbstractQueuedSynchronizer.java
oncurrent/locks/Condition.java
oncurrent/locks/Lock.java
oncurrent/locks/LockSupport.java
oncurrent/locks/ReadWriteLock.java
oncurrent/locks/ReentrantLock.java
oncurrent/locks/ReentrantReadWriteLock.java
oncurrent/locks/package-info.java
oncurrent/package-info.java
ar/Attributes.java
ar/JarEntry.java
ar/JarException.java
ar/JarFile.java
ar/JarInputStream.java
ar/JarOutputStream.java
ar/JarVerifier.java
ar/JavaUtilJarAccessImpl.java
ar/Manifest.java
ar/Pack200.java
ar/package.html
ogging/ConsoleHandler.java
ogging/ErrorManager.java
ogging/FileHandler.java
ogging/Filter.java
ogging/Formatter.java
ogging/Handler.java
ogging/Level.java
ogging/LogManager.java
ogging/LogRecord.java
ogging/Logger.java
ogging/Logging.java
ogging/LoggingMXBean.java
ogging/LoggingPermission.java
ogging/LoggingProxyImpl.java
ogging/MemoryHandler.java
ogging/SimpleFormatter.java
ogging/SocketHandler.java
ogging/StreamHandler.java
ogging/XMLFormatter.java
ogging/package.html
ackage.html
refs/AbstractPreferences.java
refs/BackingStoreException.java
refs/Base64.java
refs/FileSystemPreferences.java
refs/FileSystemPreferencesFactory.java
refs/InvalidPreferencesFormatException.java
refs/NodeChangeEvent.java
refs/NodeChangeListener.java
refs/PreferenceChangeEvent.java
refs/PreferenceChangeListener.java
refs/Preferences.java
refs/PreferencesFactory.java
refs/XmlSupport.java
refs/package.html
egex/ASCII.java
egex/MatchResult.java
egex/Matcher.java
egex/Pattern.java
egex/PatternSyntaxException.java
egex/UnicodeProp.java
egex/package.html
pi/CurrencyNameProvider.java
pi/LocaleNameProvider.java
pi/LocaleServiceProvider.java
pi/TimeZoneNameProvider.java
pi/package.html
ip/Adler32.java
ip/CRC32.java
ip/CheckedInputStream.java
ip/CheckedOutputStream.java
ip/Checksum.java
ip/DataFormatException.java
ip/Deflater.java
ip/DeflaterInputStream.java
ip/DeflaterOutputStream.java
ip/GZIPInputStream.java
ip/GZIPOutputStream.java
ip/Inflater.java
ip/InflaterInputStream.java
ip/InflaterOutputStream.java
ip/ZStreamRef.java
ip/ZipCoder.java
ip/ZipConstants.java
ip/ZipConstants64.java
ip/ZipEntry.java
ip/ZipError.java
ip/ZipException.java
ip/ZipFile.java
ip/ZipInputStream.java
ip/ZipOutputStream.java
ip/package.html