-
Bug
-
Resolution: Fixed
-
P4
-
11
-
b13
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8224078 | 11.0.5-oracle | Naoto Sato | P4 | Resolved | Fixed | b01 |
JDK-8221141 | 11.0.4-oracle | Deepak Kejriwal | P2 | Closed | Fixed | b01 |
JDK-8221927 | 11.0.4 | Naoto Sato | P4 | Resolved | Fixed | b01 |
JDK-8221805 | 11.0.3-oracle | Naoto Sato | P4 | Resolved | Fixed | b12 |
JDK-8222570 | 11.0.3 | Naoto Sato | P4 | Resolved | Fixed | b07 |
JDK-8221966 | openjdk8u222 | Naoto Sato | P4 | Resolved | Fixed | b01 |
JDK-8222579 | openjdk8u212 | Naoto Sato | P4 | Resolved | Fixed | b03 |
JDK-8222708 | 8u231 | Prasadarao Koppula | P4 | Resolved | Fixed | b01 |
JDK-8221142 | 8u221 | Deepak Kejriwal | P2 | Closed | Fixed | b01 |
JDK-8221797 | 8u212 | Prasadarao Koppula | P4 | Resolved | Fixed | b10 |
JDK-8221794 | 8u211 | Prasadarao Koppula | P4 | Resolved | Fixed | b12 |
JDK-8229656 | emb-8u231 | Unassigned | P4 | Resolved | Fixed | b01 |
JDK-8224411 | emb-8u221 | Prasadarao Koppula | P4 | Resolved | Fixed | master |
JDK-8221905 | emb-8u211 | Prasadarao Koppula | P4 | Resolved | Fixed | b12 |
At
However, parse method is still wrong.
I guess the anonymouse class in DateTimeFormatterBuilder.appendText(TemporalField field, Map<Long, String> textLookup) should override getTextIterator(TemporalField field, TextStyle style, Locale locale) too.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
{Era=2, YearOfEra=1, MonthOfYear=4},Japanese
ACTUAL -
Exception in thread "main" java.time.format.DateTimeParseException: Text 'Heisei 1st-4gatsu' could not be parsed at index 8
at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046)
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1874)
at FormatterBuilderTest_ja_jp.main(FormatterBuilderTest_ja_jp.java:26)
---------- BEGIN SOURCE ----------
import java.util.*;
import java.time.format.*;
import java.time.temporal.*;
import java.time.chrono.*;
public class FormatterBuilderTest_ja_jp {
public static void main(String[] args) {
Map<Long, String> years = Map.of(1L, "1st");
Map<Long, String> monthes = new HashMap<>();
for (long l = 1; l <= 12; l++) {
monthes.put(l, l + "gatsu");
}
DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder()
.appendText(ChronoField.ERA, TextStyle.FULL)
.appendLiteral(' ')
.appendText(ChronoField.YEAR_OF_ERA, years)
.appendLiteral('-')
.appendText(ChronoField.MONTH_OF_YEAR, monthes);
DateTimeFormatter formatter = builder.toFormatter(Locale.US)
.withChronology(JapaneseChronology.INSTANCE);
// System.out.println(formatter.parse("Heisei 1-April"));
System.out.println(formatter.parse("Heisei 1st-4gatsu"));
}
}
---------- END SOURCE ----------
FREQUENCY : always
- backported by
-
JDK-8221794 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8221797 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8221805 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8221905 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8221927 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8221966 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8222570 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8222579 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8222708 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8224078 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8224411 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8229656 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved
-
JDK-8221141 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Closed
-
JDK-8221142 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Closed
- relates to
-
JDK-8042131 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved