On Tue, 5 Mar 2024 21:23:48 GMT, Justin Lu <j...@openjdk.org> wrote:

>> test/jdk/java/text/Format/DecimalFormat/ToPatternTest.java line 60:
>> 
>>> 58:         dFmt.setMinimumFractionDigits(minFrac);
>>> 59: 
>>> 60:         String[] patterns = dFmt.toPattern().split("\\.");
>> 
>> Instead of assuming/hardcoding the decimal separator, 
>> `DecimalFormatSymbols.getInstance(Locale.US).getDecimalSeparator()` may be 
>> better.
>
> Actually, since `toPattern()` is non-localized, it will always use "." as 
> specified by DecimalFormat.
> 
> I removed the misleading comment `// Use a US dFmt, which uses '.' as the 
> decimal separator` that indicated we needed to use a DecimalFormatSymbols 
> where "." was the decimal separator. Can just simply use a DecimalFormat 
> returned by the default constructor.

Oh right. Yes, so we should not use the US locale for this test.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18094#discussion_r1513526760

Reply via email to