< prev index next >

test/jdk/java/util/Formatter/FormatLocale.java

Print this page

        

*** 105,114 **** --- 105,127 ---- ") with the default locale: '" + defaultLocale.get(i) + "'. Expected: " + expectedWithDefaultLocale.get(i) + " Returned: " + sb.toString()); } + + sb.setLength(0); + JavacIntrinsicsSupport.formatterFormat(new Formatter(sb), conversions.get(i), src.get(i)); + if (!sb.toString().equals(expectedWithDefaultLocale.get(i))) { + throw new RuntimeException( + "Wrong uppercasing while using Formatter.format(" + + "\"" + conversions.get(i) + "\"" + + ") with the default locale: '" + + defaultLocale.get(i) + + "'. Expected: " + expectedWithDefaultLocale.get(i) + + " Returned: " + sb.toString()); + } + }); // checks whether upper casing uses the locale set during creation of // Formatter instance, instead of the default locale IntStream.range(0, src.size()).forEach(i -> {
*** 119,128 **** --- 132,153 ---- if (!sb.toString().equals(expectedWithFormatLocale.get(i))) { throw new RuntimeException( "Wrong uppercasing while using Formatter.format(" + "\"" + conversions.get(i) + "\"" + ") with the locale specified during instance" + + " creation: '" + formatLocale.get(i) + + "'. Expected: " + expectedWithFormatLocale.get(i) + + " Returned: " + sb.toString()); + } + + sb.setLength(0); + JavacIntrinsicsSupport.formatterFormat(new Formatter(sb, formatLocale.get(i)), conversions.get(i), src.get(i)); + if (!sb.toString().equals(expectedWithFormatLocale.get(i))) { + throw new RuntimeException( + "Wrong uppercasing while using Formatter.format(" + + "\"" + conversions.get(i) + "\"" + + ") with the locale specified during instance" + " creation: '" + formatLocale.get(i) + "'. Expected: " + expectedWithFormatLocale.get(i) + " Returned: " + sb.toString()); } });
< prev index next >