-
Bug
-
Resolution: Fixed
-
P3
-
8u5, 11
-
b19
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8205764 | 11.0.1 | Naoto Sato | P3 | Resolved | Fixed | team |
JDK-8221965 | openjdk8u222 | Naoto Sato | P3 | Resolved | Fixed | b01 |
JDK-8222578 | openjdk8u212 | Naoto Sato | P3 | Resolved | Fixed | b03 |
JDK-8222707 | 8u231 | Prasadarao Koppula | P3 | Resolved | Fixed | b01 |
JDK-8220709 | 8u221 | Deepak Kejriwal | P2 | Closed | Fixed | b01 |
JDK-8221796 | 8u212 | Prasadarao Koppula | P3 | Resolved | Fixed | b10 |
JDK-8221793 | 8u211 | Prasadarao Koppula | P3 | Resolved | Fixed | b12 |
JDK-8229655 | emb-8u231 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8224410 | emb-8u221 | Prasadarao Koppula | P3 | Resolved | Fixed | master |
JDK-8221904 | emb-8u211 | Prasadarao Koppula | P3 | Resolved | Fixed | b12 |
work for LocalDate.
The problem occurs with both toFormatter(Locale.US) and toFormatter(Locale.JAPANESE).
TESTCASE
--------
import java.text.*;
import java.util.*;
import java.time.*;
import java.time.format.*;
import java.time.temporal.*;
import java.time.chrono.*;
public class FormatterBuilderTest_ja_jp{
public static void main(String[] args) {
String str;
DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
Map<Long, String> yearMap = new HashMap<>();
yearMap.put(1L, "1st");
Map<Long, String> monthMap = new HashMap<>();
for (long l = 1; l <= 12; l++) {
monthMap.put(l, l+"gatsu");
}
builder.appendText(ChronoField.ERA, TextStyle.FULL);
builder.appendLiteral(' ');
builder.appendText(ChronoField.YEAR_OF_ERA, yearMap);
builder.appendLiteral('-');
builder.appendText(ChronoField.MONTH_OF_YEAR, monthMap);
DateTimeFormatter formatter = builder.toFormatter(Locale.US);
// DateTimeFormatter formatter =
builder.toFormatter(Locale.JAPANESE);
JapaneseDate date = JapaneseDate.of(JapaneseEra.HEISEI, 1, 4, 1);
str = date.format(formatter);
System.out.println(str);
LocalDate local = LocalDate.of( 1, 4, 1);
str = local.format(formatter);
System.out.println(str);
}
}
REPRODUCTION INSTRUCTIONS
-------------------------
Compile and run the testcase.
Observed output:
> Heisei 1-April <== Problem
> Anno Domini 1st-4gatsu
Expected output:
> Heisei 1st-4gatsu
> Anno Domini 1st-4gatsu
- backported by
-
JDK-8205764 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8221793 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8221796 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8221904 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8221965 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8222578 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8222707 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8224410 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8229655 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Resolved
-
JDK-8220709 DateTimeFormatterBuilder Mapped-values do not work for JapaneseDate
- Closed
- relates to
-
JDK-8210633 Cannot parse JapaneseDate string with DateTimeFormatterBuilder Mapped-values
- Resolved