RFR: 8164805: Fail to create a MR modular JAR with a versioned entry in base-versioned empty package

Mandy Chung mandy.chung at oracle.com
Thu Oct 20 00:33:31 UTC 2016


> On Oct 19, 2016, at 5:22 PM, Steve Drach <steve.drach at oracle.com> wrote:
> 
>> 76     private String files(Path start) throws IOException {
>> Perhaps return Stream<String>.  That can replace the unnecessary concat in a String and then later split to pass to javac.
> 
> Is this better?
> 
>    private void javac(Path source, Path destination) throws IOException {
>        Stream<String> prefix = Stream.of("-d", destination.toString());
>        Stream<String> suffix = Files.isDirectory(source)
>                ? Files.walk(source)
>                       .map(Path::toString)
>                       .filter(s -> s.endsWith(".java"))
>                : Stream.of(source.toString());
>        String[] args = Stream.concat(prefix, suffix).toArray(String[]::new);
>        JAVAC_TOOL.run(System.out, System.err, args);
>    }


This is okay.

Mandy


More information about the core-libs-dev mailing list