8220804: Help message for @ argfile option is printed in the wrong place
Reviewed-by: almatvee, kbr
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Mon Mar 18 09:09:36 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Thu Mar 21 13:46:28 2019 -0400
@@ -124,11 +124,9 @@
private static Map<String, CLIOptions> argIds = new HashMap<>();
private static Map<String, CLIOptions> argShortIds = new HashMap<>();
- {
+ static {
// init maps for parsing arguments
- EnumSet<CLIOptions> options = EnumSet.allOf(CLIOptions.class);
-
- options.forEach(option -> {
+ (EnumSet.allOf(CLIOptions.class)).forEach(option -> {
argIds.put(option.getIdWithPrefix(), option);
if (option.getShortIdWithPrefix() != null) {
argShortIds.put(option.getShortIdWithPrefix(), option);
@@ -137,7 +135,19 @@
}
public Arguments(String[] args) throws PackagerException {
- initArgumentList(args);
+ argList = new ArrayList<String>(args.length);
+ for (String arg : args) {
+ argList.add(arg);
+ }
+ Log.debug ("\njpackage argument list: \n" + argList + "\n");
+ pos = 0;
+
+ deployParams = new DeployParams();
+ bundleType = BundlerType.NONE;
+
+ allOptions = new ArrayList<>();
+
+ addLaunchers = new ArrayList<>();
}
// CLIOptions is public for DeployParamsTest
@@ -474,22 +484,6 @@
PLATFORM_LINUX;
}
- private void initArgumentList(String[] args) throws PackagerException {
- argList = new ArrayList<String>(args.length);
- for (String arg : args) {
- argList.add(arg);
- }
- Log.debug ("\njpackage argument list: \n" + argList + "\n");
- pos = 0;
-
- deployParams = new DeployParams();
- bundleType = BundlerType.NONE;
-
- allOptions = new ArrayList<>();
-
- addLaunchers = new ArrayList<>();
- }
-
public boolean processArguments() throws Exception {
try {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Mon Mar 18 09:09:36 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java Thu Mar 21 13:46:28 2019 -0400
@@ -226,17 +226,7 @@
}
public void addResource(File baseDir, String path) {
- File file = new File(baseDir, path);
- // normalize top level dir
- // to strip things like "." in the path
- // or it can confuse symlink detection logic
- file = file.getAbsoluteFile();
-
- if (baseDir == null) {
- baseDir = file.getParentFile();
- }
- resources.add(new RelativeFileSet(
- baseDir, new LinkedHashSet<>(expandFileset(file))));
+ addResource(baseDir, new File(baseDir, path));
}
public void addResource(File baseDir, File file) {
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties Mon Mar 18 09:09:36 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources.properties Thu Mar 21 13:46:28 2019 -0400
@@ -58,9 +58,9 @@
\n\
Generic Options:\n\
\ @<filename> \n\
+\ Read options and/or mode from a file \n\
\ --app-version <version>\n\
\ Version of the application and/or installer\n\
-\ Read options and/or mode from a file \n\
\ --copyright <copyright string>\n\
\ Copyright for the application\n\
\ --description <description string>\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Mon Mar 18 09:09:36 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_ja.properties Thu Mar 21 13:46:28 2019 -0400
@@ -58,9 +58,9 @@
\n\
Generic Options:\n\
\ @<filename> \n\
+\ Read options and/or mode from a file \n\
\ --app-version <version>\n\
\ Version of the application and/or installer\n\
-\ Read options and/or mode from a file \n\
\ --copyright <copyright string>\n\
\ Copyright for the application\n\
\ --description <description string>\n\
--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Mon Mar 18 09:09:36 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/resources/HelpResources_zh_CN.properties Thu Mar 21 13:46:28 2019 -0400
@@ -58,9 +58,9 @@
\n\
Generic Options:\n\
\ @<filename> \n\
+\ Read options and/or mode from a file \n\
\ --app-version <version>\n\
\ Version of the application and/or installer\n\
-\ Read options and/or mode from a file \n\
\ --copyright <copyright string>\n\
\ Copyright for the application\n\
\ --description <description string>\n\