File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
graphviz-java/src/main/java/guru/nidi/graphviz/engine Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -48,22 +48,26 @@ public class GraphvizCmdLineEngine extends AbstractGraphvizEngine {
4848 private String outputFileName ;
4949
5050 public GraphvizCmdLineEngine () {
51- this (Optional .ofNullable (System .getenv ("PATH" )).orElse ("" ), new CommandLineExecutor ());
51+ this (Optional .ofNullable (System .getenv ("PATH" )).orElse ("" ), defaultExecutor ());
5252 }
5353
5454 public GraphvizCmdLineEngine (String envPath , CommandLineExecutor executor ) {
5555 super (true );
56- if (!AVAILABLE ) {
57- throw new MissingDependencyException ("Command line engine is not available." ,
58- "org.apache.commons:commons-exec" );
59- }
6056 this .envPath = envPath ;
6157 cmdRunner = new CommandBuilder ()
6258 .withShellWrapper (true )
6359 .withCommandExecutor (executor )
6460 .build ();
6561 }
6662
63+ private static CommandLineExecutor defaultExecutor () {
64+ if (!AVAILABLE ) {
65+ throw new MissingDependencyException ("Command line engine is not available." ,
66+ "org.apache.commons:commons-exec" );
67+ }
68+ return new CommandLineExecutor ();
69+ }
70+
6771 @ SuppressWarnings ("unchecked" )
6872 public GraphvizCmdLineEngine timeout (int amount , TimeUnit unit ) {
6973 return super .timeout (amount , unit );
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public class GraphvizJdkEngine extends AbstractJsGraphvizEngine {
2626 public GraphvizJdkEngine () {
2727 super (false , GraphvizJdkEngine ::newEngine );
2828 if (!AVAILABLE ) {
29- throw new MissingDependencyException ("JDK engine is not available" , "net.arnx:nashorn-promise" );
29+ throw new MissingDependencyException ("JDK engine is not available. " , "net.arnx:nashorn-promise" );
3030 }
3131 }
3232
You can’t perform that action at this time.
0 commit comments