Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,12 @@ public static void writeStringOfCFG(
*/
private static void producePDF(String file) {
try {
String command = "dot -Tpdf \"" + file + "\" -o \"" + file + ".pdf\"";
Process child = Runtime.getRuntime().exec(new String[] {"/bin/sh", "-c", command});
child.waitFor();
ProcessBuilder pb = new ProcessBuilder("dot", "-Tpdf", file, "-o", file + ".pdf");
Process child = pb.start();
int exitCode = child.waitFor();
if (exitCode != 0) {
System.err.println("dot exited with status " + exitCode);
}
} catch (InterruptedException | IOException e) {
e.printStackTrace();
System.exit(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ProcessBuilder.Redirect;
import java.net.JarURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -52,7 +51,6 @@
import org.checkerframework.javacutil.TypesUtils;
import org.plumelib.util.CollectionsPlume;
import org.plumelib.util.IPair;
import org.plumelib.util.SystemPlume;

/**
* Holds information about types parsed from annotation files (stub files or ajava files). When
Expand Down Expand Up @@ -929,20 +927,7 @@ private void prepJdkFromJar(@SuppressWarnings("UnusedVariable") URL jdkJarfile)
"End of remainingJdkStubFilesJar for %s from %s.%n", factoryClass, jarFileURL);

System.out.printf("Contents of %s:%n", jarFileURL);
assert jarFileURL.startsWith("file:");
ProcessBuilder pb =
new ProcessBuilder(
"/bin/sh", "-c", "jar tf '" + jarFileURL.substring(5) + "' | LC_ALL=C sort");
pb.redirectOutput(Redirect.INHERIT);
pb.redirectError(Redirect.INHERIT);
Process p = pb.start();
try {
p.waitFor();
} catch (InterruptedException e) {
// do nothing
}
System.out.flush();
SystemPlume.sleep(1);
printSortedIndented(entries.stream().map(JarEntry::getName).collect(Collectors.toList()));
System.out.printf("End of %s.%n", jarFileURL);
}
} catch (IOException e) {
Expand Down
Loading