JDK 10 RFR of JDK-8181575: Refactor locale related shell test java/nio/charset/spi/basic.sh to java

Paul Sandoz paul.sandoz at oracle.com
Mon Jun 19 18:46:08 UTC 2017


Minor stuff below, no need for another round from me.

Paul.

CharsetProviderBasicTest
—

  85     public static Iterator<Object[]> testCases() {
  86         List<Object[]> cases = new ArrayList<>();
  87         Stream.of("", "ja_JP.eucJP", "tr_TR")
  88               .forEach(locale -> {
  89                   cases.add(new Object[]{locale, List.of(""), "FOO"});
  90                   cases.add(new Object[]{locale, MINIMAL_POLICY, "!FOO"});
  91                   cases.add(new Object[]{locale, CP_POLICY, "FOO"});
  92               });
  93         return cases.iterator();


More for educational purposes. You can use flatMap(l -> Stream.of(…)).iterator() rather than using a list to hold the contents.


 117         if (!locale.equals("")) {

if (!locale.isEmpty())) {



> On 18 Jun 2017, at 23:09, Amy Lu <amy.lu at oracle.com> wrote:
> 
> java/nio/charset/spi/basic.sh
> 
> Please review this patch to refactor the shell test to java.
> 
> bug: https://bugs.openjdk.java.net/browse/JDK-8181575
> webrev: http://cr.openjdk.java.net/~amlu/8181575/webrev.00/
> 
> Thanks,
> Amy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170619/2e9cbe73/signature.asc>


More information about the nio-dev mailing list