langtools/test/tools/jdeps/Basic.java
changeset 38524 badd925c1d2f
parent 36526 3b41f1c69604
equal deleted inserted replaced
38523:e8ff97117086 38524:badd925c1d2f
    37 import java.io.StringWriter;
    37 import java.io.StringWriter;
    38 import java.nio.file.Files;
    38 import java.nio.file.Files;
    39 import java.nio.file.Path;
    39 import java.nio.file.Path;
    40 import java.util.*;
    40 import java.util.*;
    41 import java.util.regex.*;
    41 import java.util.regex.*;
       
    42 import java.util.stream.Collectors;
       
    43 
    42 import static java.nio.file.StandardCopyOption.*;
    44 import static java.nio.file.StandardCopyOption.*;
    43 
    45 
    44 public class Basic {
    46 public class Basic {
    45     public static void main(String... args) throws Exception {
    47     public static void main(String... args) throws Exception {
    46         int errors = 0;
    48         int errors = 0;
   155     }
   157     }
   156 
   158 
   157     Map<String,String> jdeps(String... args) {
   159     Map<String,String> jdeps(String... args) {
   158         StringWriter sw = new StringWriter();
   160         StringWriter sw = new StringWriter();
   159         PrintWriter pw = new PrintWriter(sw);
   161         PrintWriter pw = new PrintWriter(sw);
   160         System.err.println("jdeps " + Arrays.toString(args));
   162         System.err.println("jdeps " + Arrays.stream(args).collect(Collectors.joining(" ")));
   161         int rc = com.sun.tools.jdeps.Main.run(args, pw);
   163         int rc = com.sun.tools.jdeps.Main.run(args, pw);
   162         pw.close();
   164         pw.close();
   163         String out = sw.toString();
   165         String out = sw.toString();
   164         if (!out.isEmpty())
   166         if (!out.isEmpty())
   165             System.err.println(out);
   167             System.err.println(out);