< prev index next >

src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java

Print this page

        

@@ -62,11 +62,10 @@
  */
 public class Arguments {
     private static final ResourceBundle I18N = ResourceBundle.getBundle(
             "jdk.jpackage.internal.resources.MainResources");
 
-    private static final String IMAGE_PACKAGE_TYPE = "app-image";
     private static final String FA_EXTENSIONS = "extension";
     private static final String FA_CONTENT_TYPE = "mime-type";
     private static final String FA_DESCRIPTION = "description";
     private static final String FA_ICON = "icon";
 

@@ -375,12 +374,11 @@
         public String getId() {
             return this.id;
         }
 
         String getIdWithPrefix() {
-            String prefix = isMode() ? "" : "--";
-            return prefix + this.id;
+            return "--" + this.id;
         }
 
         String getShortIdWithPrefix() {
             return this.shortId == null ? null : "-" + this.shortId;
         }

@@ -391,14 +389,10 @@
             } else {
                 defaultAction();
             }
         }
 
-        boolean isMode() {
-            return category == OptionCategories.MODE;
-        }
-
         OptionCategories getCategory() {
             return category;
         }
 
         private void defaultAction() {

@@ -422,21 +416,16 @@
 
         private static void nextArg() {
             context().pos++;
         }
 
-        private static void prevArg() {
-            context().pos--;
-        }
-
         private static boolean hasNextArg() {
             return context().pos < context().argList.size();
         }
     }
 
     enum OptionCategories {
-        MODE,
         MODULAR,
         PROPERTY,
         PLATFORM_MAC,
         PLATFORM_WIN,
         PLATFORM_LINUX;

@@ -539,11 +528,11 @@
     }
 
     private void validateArguments() throws PackagerException {
         String packageType = deployParams.getTargetFormat();
         String ptype = (packageType != null) ? packageType : "default";
-        boolean imageOnly = IMAGE_PACKAGE_TYPE.equals(packageType);
+        boolean imageOnly = (packageType == null);
         boolean hasAppImage = allOptions.contains(
                 CLIOptions.PREDEFINED_APP_IMAGE);
         boolean hasRuntime = allOptions.contains(
                 CLIOptions.PREDEFINED_RUNTIME_IMAGE);
         boolean installerOnly = !imageOnly && hasAppImage;

@@ -692,14 +681,10 @@
         fileNames.forEach(file -> deployParams.addResource(baseDir, file));
 
         deployParams.setClasspath();
     }
 
-    static boolean isCLIOption(String arg) {
-        return toCLIOption(arg) != null;
-    }
-
     static CLIOptions toCLIOption(String arg) {
         CLIOptions option;
         if ((option = argIds.get(arg)) == null) {
             option = argShortIds.get(arg);
         }
< prev index next >