Skip to content

Commit 67cbfb0

Browse files
CommandLine.parse() doesn't throw java.io.FileNotFoundException when command file is no found. Instead it throws java.nio.file.NoSuchFileException.
1 parent a8fd72f commit 67cbfb0

File tree

1 file changed

+8
-7
lines changed
  • src/jdk.jpackage/share/classes/jdk/jpackage/main

1 file changed

+8
-7
lines changed

src/jdk.jpackage/share/classes/jdk/jpackage/main/Main.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@
2525

2626
package jdk.jpackage.main;
2727

28-
import jdk.internal.opt.CommandLine;
29-
import jdk.jpackage.internal.Arguments;
30-
import jdk.jpackage.internal.Log;
31-
import jdk.jpackage.internal.CLIHelp;
32-
import java.io.PrintWriter;
33-
import java.util.ResourceBundle;
3428
import java.io.FileNotFoundException;
3529
import java.io.IOException;
30+
import java.io.PrintWriter;
31+
import java.nio.file.NoSuchFileException;
3632
import java.text.MessageFormat;
33+
import java.util.ResourceBundle;
34+
import jdk.internal.opt.CommandLine;
35+
import jdk.jpackage.internal.Arguments;
36+
import jdk.jpackage.internal.CLIHelp;
37+
import jdk.jpackage.internal.Log;
3738

3839
public class Main {
3940

@@ -69,7 +70,7 @@ public int execute(PrintWriter out, PrintWriter err, String... args) {
6970
String[] newArgs;
7071
try {
7172
newArgs = CommandLine.parse(args);
72-
} catch (FileNotFoundException fnfe) {
73+
} catch (FileNotFoundException|NoSuchFileException fnfe) {
7374
Log.fatalError(MessageFormat.format(I18N.getString(
7475
"ERR_CannotParseOptions"), fnfe.getMessage()));
7576
return 1;

0 commit comments

Comments
 (0)