src/jdk.jpackage/share/classes/jdk/jpackage/internal/SecondaryLauncherArguments.java
author kcr
Thu, 10 Jan 2019 11:30:09 -0800
branchJDK-8200758-branch
changeset 57106 ea870b9ce89a
parent 57099 9a85a7a076ad
permissions -rw-r--r--
8216492: Update copyright of all new jpackage fils to 2019 Reviewed-by: herrick
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     1
/*
57106
ea870b9ce89a 8216492: Update copyright of all new jpackage fils to 2019
kcr
parents: 57099
diff changeset
     2
 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     4
 *
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    10
 *
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    15
 * accompanied this code).
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    16
 *
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    20
 *
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    23
 * questions.
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    24
 */
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    25
57039
98d3963b0b7b 8214051: rename jpackager tool to jpackage
herrick
parents: 57017
diff changeset
    26
package jdk.jpackage.internal;
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    27
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    28
import java.util.Collection;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    29
import java.util.HashMap;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    30
import java.util.Map;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    31
import java.io.File;
57039
98d3963b0b7b 8214051: rename jpackager tool to jpackage
herrick
parents: 57017
diff changeset
    32
import jdk.jpackage.internal.Arguments.CLIOptions;
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    33
56994
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    34
/*
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    35
 * SecondaryLauncherArguments
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    36
 *
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    37
 * Processes a secondary launcher properties file to create the Map of
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    38
 * bundle params applicable to the secondary launcher:
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    39
 *
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    40
 * BundlerParams p = (new SecondaryLauncherArguments(file)).getLauncherMap();
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    41
 *
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    42
 * A secondary launcher is another executable program generated by either the
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    43
 * create-image mode or the create-installer mode.
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    44
 * The secondary launcher may be the same program with different configuration,
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    45
 * or a completely different program created from the same files.
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    46
 *
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    47
 * There may be multiple secondary launchers, each created by using the
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    48
 * command line arg "--secondary-launcher <file path>
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    49
 *
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    50
 * The secondary launcher properties file may have any of:
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    51
 *
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    52
 * name (required)
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    53
 * version
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    54
 * module
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    55
 * class
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    56
 * icon
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    57
 * arguments
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    58
 * jvm-args
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    59
 * win-menu
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    60
 * win-shortcut
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    61
 * win-console
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    62
 *
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
    63
 */
57067
9c17d779808e 8213425: Analyze output from Source code scanner and fix where needed.
herrick
parents: 57039
diff changeset
    64
class SecondaryLauncherArguments {
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    65
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    66
    private final String filename;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    67
    private Map<String, String> allArgs;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    68
    private Map<String, ? super Object> bundleParams;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    69
57067
9c17d779808e 8213425: Analyze output from Source code scanner and fix where needed.
herrick
parents: 57039
diff changeset
    70
    SecondaryLauncherArguments(String filename) {
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    71
        this.filename = filename;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    72
    }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    73
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    74
    private void initLauncherMap() {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    75
        if (bundleParams != null) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    76
            return;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    77
        }
56957
2f01969ed7cb 8211299: Output of System.out is not printed to CMD on Windows
herrick
parents: 56933
diff changeset
    78
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    79
        allArgs = Arguments.getPropertiesFromFile(filename);
56957
2f01969ed7cb 8211299: Output of System.out is not printed to CMD on Windows
herrick
parents: 56933
diff changeset
    80
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    81
        bundleParams = new HashMap<>();
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    82
        String mainClass = getOptionValue(CLIOptions.APPCLASS);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    83
        String module = getOptionValue(CLIOptions.MODULE);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    84
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    85
        if (module != null && mainClass != null) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    86
            putUnlessNull(bundleParams, Arguments.CLIOptions.MODULE.getId(),
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    87
                    module + "/" + mainClass);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    88
        } else if (module != null) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    89
            putUnlessNull(bundleParams, Arguments.CLIOptions.MODULE.getId(),
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    90
                    module);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    91
        } else if (mainClass != null) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    92
            putUnlessNull(bundleParams, Arguments.CLIOptions.APPCLASS.getId(),
56957
2f01969ed7cb 8211299: Output of System.out is not printed to CMD on Windows
herrick
parents: 56933
diff changeset
    93
                    mainClass);
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    94
        }
56957
2f01969ed7cb 8211299: Output of System.out is not printed to CMD on Windows
herrick
parents: 56933
diff changeset
    95
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    96
        putUnlessNull(bundleParams, Arguments.CLIOptions.NAME.getId(),
56869
41e17fe9fbeb 8208522: removed unreferenced class and minor formatting of java source
herrick
parents: 56849
diff changeset
    97
                getOptionValue(CLIOptions.NAME));
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
    98
        putUnlessNull(bundleParams, Arguments.CLIOptions.VERSION.getId(),
56869
41e17fe9fbeb 8208522: removed unreferenced class and minor formatting of java source
herrick
parents: 56849
diff changeset
    99
                getOptionValue(CLIOptions.VERSION));
56957
2f01969ed7cb 8211299: Output of System.out is not printed to CMD on Windows
herrick
parents: 56933
diff changeset
   100
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   101
        putUnlessNull(bundleParams, Arguments.CLIOptions.WIN_MENU_HINT.getId(),
56869
41e17fe9fbeb 8208522: removed unreferenced class and minor formatting of java source
herrick
parents: 56849
diff changeset
   102
                getOptionValue(CLIOptions.WIN_MENU_HINT));
41e17fe9fbeb 8208522: removed unreferenced class and minor formatting of java source
herrick
parents: 56849
diff changeset
   103
        putUnlessNull(bundleParams,
41e17fe9fbeb 8208522: removed unreferenced class and minor formatting of java source
herrick
parents: 56849
diff changeset
   104
                Arguments.CLIOptions.WIN_SHORTCUT_HINT.getId(),
41e17fe9fbeb 8208522: removed unreferenced class and minor formatting of java source
herrick
parents: 56849
diff changeset
   105
                getOptionValue(CLIOptions.WIN_SHORTCUT_HINT));
56982
e094d5483bd6 8212048: Cleanup source code and fix issues discussed in preliminary review
herrick
parents: 56957
diff changeset
   106
        putUnlessNull(bundleParams,
e094d5483bd6 8212048: Cleanup source code and fix issues discussed in preliminary review
herrick
parents: 56957
diff changeset
   107
                Arguments.CLIOptions.WIN_CONSOLE_HINT.getId(),
56957
2f01969ed7cb 8211299: Output of System.out is not printed to CMD on Windows
herrick
parents: 56933
diff changeset
   108
                getOptionValue(CLIOptions.WIN_CONSOLE_HINT));
56994
b4aca2dbe2b5 8212537: Create method and class description comments for main functionality
herrick
parents: 56982
diff changeset
   109
56849
16c34c7b4147 8208579: [jpackager] --secondary-launcher arg fails when properties file has no icon
herrick
parents: 56821
diff changeset
   110
        String value = getOptionValue(CLIOptions.ICON);
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   111
        putUnlessNull(bundleParams, Arguments.CLIOptions.ICON.getId(),
56869
41e17fe9fbeb 8208522: removed unreferenced class and minor formatting of java source
herrick
parents: 56849
diff changeset
   112
                (value == null) ? null : new File(value));
56957
2f01969ed7cb 8211299: Output of System.out is not printed to CMD on Windows
herrick
parents: 56933
diff changeset
   113
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   114
        String argumentStr = getOptionValue(CLIOptions.ARGUMENTS);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   115
        putUnlessNullOrEmpty(bundleParams,
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   116
                CLIOptions.ARGUMENTS.getId(),
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   117
                Arguments.getArgumentList(argumentStr));
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   118
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   119
        String jvmargsStr = getOptionValue(CLIOptions.JVM_ARGS);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   120
        putUnlessNullOrEmpty(bundleParams,
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   121
                CLIOptions.JVM_ARGS.getId(),
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   122
                Arguments.getArgumentList(jvmargsStr));
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   123
    }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   124
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   125
    private String getOptionValue(CLIOptions option) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   126
        if (option == null || allArgs == null) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   127
            return null;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   128
        }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   129
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   130
        String id = option.getId();
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   131
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   132
        if (allArgs.containsKey(id)) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   133
            return allArgs.get(id);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   134
        }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   135
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   136
        return null;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   137
    }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   138
57067
9c17d779808e 8213425: Analyze output from Source code scanner and fix where needed.
herrick
parents: 57039
diff changeset
   139
    Map<String, ? super Object> getLauncherMap() {
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   140
        initLauncherMap();
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   141
        return bundleParams;
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   142
    }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   143
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   144
    private void putUnlessNull(Map<String, ? super Object> params,
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   145
            String param, Object value) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   146
        if (value != null) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   147
            params.put(param, value);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   148
        }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   149
    }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   150
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   151
    private void putUnlessNullOrEmpty(Map<String, ? super Object> params,
57015
5d2008115309 JDK-8213244: Fix all warnings in jpackager java code
herrick
parents: 56994
diff changeset
   152
            String param, Collection<?> value) {
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   153
        if (value != null && !value.isEmpty()) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   154
            params.put(param, value);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   155
        }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   156
    }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   157
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   158
    private void putUnlessNullOrEmpty(Map<String, ? super Object> params,
57015
5d2008115309 JDK-8213244: Fix all warnings in jpackager java code
herrick
parents: 56994
diff changeset
   159
            String param, Map<?, ?> value) {
56821
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   160
        if (value != null && !value.isEmpty()) {
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   161
            params.put(param, value);
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   162
        }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   163
    }
565d54ca1f41 8206005: Move prototype jpackager from closed sandbox to open sandbox
herrick
parents:
diff changeset
   164
}