> 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); }