Verify SimpleDateFormat.java against 8u121-b13 (part 3)
This CL fixes incorrect behavior after past refactoring: when the switch
cases in subFormat() that handle 'L' and 'M' format strings were
extracted to formatMonth() helper method, the behavior difference was
introduced. It happens when no dateFormatSymbols are used AND there are
more than three modifiers in format string. It leads to not adding
standalone flag to style variable when requesting calendar data for
month display name. So previously if January in Russian locale was
formatted using "LLLLL" (standalone form), the expected result would be
"Январь" (nominative case), but the actual result would be "Января"
("context-sensitive" genitive case) -- notice the difference in the last
letter.
The fix is straightforward: add missing else-clause that handles cases
when more than three modifiers are given as input and adds standalone
flag to style before requesting month display name.
Added corresponding test cases in Russian and Czech locale (they both
have different results in context-(in)sensitive forms).
This CL finishes verification of SimpleDateFormat.java.
Bug: 66411240
Test: cts-tradefed run cts -m CtsLibcoreTestCases --abi arm64-v8a
Change-Id: I58298b293ec5dc63e300561ebdc4cb27812b7076
3 files changed