History log of /libcore/ojluni/src/main/java/java/time/format/DateTimeFormatterBuilder.java
Revision Date Author Comments
b73434f614f386111e0032d63964dd9064a5c1b9 22-Sep-2017 Joachim Sauer <jsauer@google.com> Improve change comments in java.time.format

Improve Android-changed/-removed/-added comments in
DateTimeFormatterBuilder, DateTimeTextProvider and ZoneName.

Bug: 35910877
Test: m (comment-only changes)
Change-Id: I036856df20a151096c6ddcb876c28b1e3ead2a2c
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
ccb870a11faca902de6ef41f5d252d93b9bd0378 15-Nov-2016 Joachim Sauer <jsauer@google.com> Change time zone tests to respect Android changes.

There is a difference in how java.time on the OpenJDK treats time zone
names and how Android as a whole treats them, specifically when it comes
to the short names (abbreviations) of zones.

Android uses the CLDR data exclusively. CLDR only includes time zone
abbreviations in a given locale when that abbreviation is widely used in
that locale (for example: "CST" is "Central Standard Time" in en_US).
Other abbreviations that are arguably correct, but are not widely known
or used are not included in the data, such as "CST" for "Chinese
Standard Time". This means that there are rarely conflicts in the
abbreviations and no resolution mechanism is needed (and in fact ICU
doesn't provide one).

java.time in the OpenJDK (as well as other time zone name handling
methods) has abbreviations for almost every zone, even when the zones
are rarely used. This of course leads to many conflicts (such as CST for
Central Standard Time and Chinese Standard Time).

This port of java.time will stay consistent with how Android as a whole
handles time zone names and will use the ICU/CLDR data. This means that
many tests that expect specific results will fail.

Bug: 28832222
Test: compiles, fewer tests fail
Change-Id: Ic23c2795a440d61d97db8c4c44cfd35a053c0105
6cfa38d67bfe090c8aeb809cc01f772b257e0a7a 15-Nov-2016 Joachim Sauer <jsauer@google.com> Use ICU data for time zone name parsing.

Use ICU time zone names in DateTimeFormatterBuilder to parse time zone
names and IDs (formatting was done in a previous commit).

Also remove built-in alias and metazone data from ZoneNames and use ICU
data directly.

Don't provide GMT+0 and GMT-0 zone ids from the IcuZoneRulesProvider, as
those are not parseable by ZoneId.

Also improve time zone formatting to print generic GMT string, if no
name is available.

Bug: 28832222
Test: compiles, tests follow later.
Change-Id: Ifea756ff5163dbd032960d82e88da9dfee1ff0cc
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
c9dd3385ea6f927052783f42fb1282fb093e636e 01-Sep-2016 Joachim Sauer <jsauer@google.com> Initial import of java.time.

This is a verbatim copy of the classes in java.time from the jdk8u60
branch of the OpenJDK.

They are not yet part of the build and wouldn't compile yet (no local
modifications whatsoever).

Bug: 28832222
Test: Not build, not tested.
Change-Id: I8bb148cb1095b08af895c4abffed9f22b107c218