Merge pull request #3086 from apache/delivery

delivery to release125
diff --git a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties
index 3c5f379..893cab1 100644
--- a/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties
+++ b/enterprise/glassfish.common/src/org/netbeans/modules/glassfish/common/wizards/Bundle.properties
@@ -116,7 +116,7 @@
 TIME_MINUTES={0,choice, 1#{0} minute|2#{0} minutes}
 TIME_SECONDS={0,choice, 1#{0} second|2#{0} seconds}
 TIME_MILISECONDS={0} ms
-TIME_SEPARATOR=,\
+TIME_SEPARATOR=,\ 
 LBL_InstallLocation=Installation &Location:
 V3_PRELUDE_NAME=GlassFish v3 Prelude
 V3_EE6_NAME=GlassFish Server 3
@@ -174,7 +174,7 @@
 AddServerLocationVisualPanel.remoteDomainRadioButton=Remote Domain
 AddServerLocationVisualPanel.localDomainRadioButton=Local Domain
 AddDomainLocationVisualPanel.targetValueLabel.text=&Target:
-AddDomainLocationVisualPanel.targetValueField.text=\ \ \ \ \ \ \ \ \ \ \ \ \ \
+AddDomainLocationVisualPanel.targetValueField.text=\ \ \ \ \ \ \ \ \ \ \ \ \ \ 
 AddDomainLocationVisualPanel.userNameLabel.text=&User Name:
 AddDomainLocationVisualPanel.passwordLabel.text=Pass&word:
 AddDomainLocationVisualPanel.httpPortFieldLabel.text=HTTP Port:
diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/ServerTasks.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/ServerTasks.java
index dfa31e5..e6c23a7 100644
--- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/ServerTasks.java
+++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/ServerTasks.java
@@ -303,19 +303,33 @@
      */
     private static void appendOptions(StringBuilder argumentBuf,
             List<String> optList, Map<String, String> varMap) {
-        final String METHOD = "appendOptions";
-        HashMap<String, String> keyValueArgs = new HashMap<>();
-        LinkedList<String> keyOrder = new LinkedList<>();
-        String name, value;
+        final boolean isWindows = OsUtils.isWin();
+        final String METHOD = "appendOptions"; // NOI18N
+        // override the values that are found in the domain.xml file.
+        // this is totally a copy/paste from StartTomcat...
+        final Map<String,String> PROXY_PROPS = new HashMap<>();
+        for(String s: new String[] {
+            "http.proxyHost", // NOI18N
+            "http.proxyPort", // NOI18N
+            "http.nonProxyHosts", // NOI18N
+            "https.proxyHost", // NOI18N
+            "https.proxyPort", // NOI18N
+        }) {
+            PROXY_PROPS.put(JavaUtils.systemPropertyName(s), s);
+            PROXY_PROPS.put("-D\"" + s, s); // NOI18N
+            PROXY_PROPS.put("-D" + s, s); // NOI18N
+        }
+
         // first process optList aquired from domain.xml 
         for (String opt : optList) {
+            String name, value;
             // do placeholder substitution
             opt = Utils.doSub(opt.trim(), varMap);
             int splitIndex = opt.indexOf('=');
             // && !opt.startsWith("-agentpath:") is a temporary hack to
             // not touch already quoted -agentpath. Later we should handle it
             // in a better way.
-            if (splitIndex != -1 && !opt.startsWith("-agentpath:")) {
+            if (splitIndex != -1 && !opt.startsWith("-agentpath:")) { // NOI18N
                 // key=value type of option
                 name = opt.substring(0, splitIndex);
                 value = Utils.quote(opt.substring(splitIndex + 1));
@@ -325,44 +339,27 @@
             } else {
                 name = opt;
                 value = null;
-                LOGGER.log(Level.FINER, METHOD, "jvmOpt", name);
+                LOGGER.log(Level.FINER, METHOD, "jvmOpt", name); // NOI18N
             }
-            if (!keyValueArgs.containsKey(name)) {
-                keyOrder.add(name);
-            }
-            keyValueArgs.put(name, value);
-        }
 
-        // override the values that are found in the domain.xml file.
-        // this is totally a copy/paste from StartTomcat...
-        final String[] PROXY_PROPS = {
-            "http.proxyHost", // NOI18N
-            "http.proxyPort", // NOI18N
-            "http.nonProxyHosts", // NOI18N
-            "https.proxyHost", // NOI18N
-            "https.proxyPort", // NOI18N
-        };
-        boolean isWindows = OsUtils.isWin();
-        for (String prop : PROXY_PROPS) {
-            value = System.getProperty(prop);
-            if (value != null && value.trim().length() > 0) {
-                if (isWindows && "http.nonProxyHosts".equals(prop)) {
-                    // enclose in double quotes to escape the pipes separating
-                    // the hosts on windows
-                    value = "\"" + value + "\""; // NOI18N
+            if(PROXY_PROPS.containsKey(name)) {
+                String sysValue = System.getProperty(PROXY_PROPS.get(name));
+                if (sysValue != null && sysValue.trim().length() > 0) {
+                    if (isWindows && "http.nonProxyHosts".equals(PROXY_PROPS.get(name))) { // NOI18N
+                        // enclose in double quotes to escape the pipes separating
+                        // the hosts on windows
+                        sysValue = "\"" + value + "\""; // NOI18N
+                    }
+                    name = JavaUtils.systemPropertyName(PROXY_PROPS.get(name));
+                    value = sysValue;
                 }
-                keyValueArgs.put(JavaUtils.systemPropertyName(prop), value);
             }
-        }
 
-        // appending key=value options to the command line argument
-        // using the same order as they came in argument - important!
-        for (String key : keyOrder) {
             argumentBuf.append(' ');
-            argumentBuf.append(key);
-            if (keyValueArgs.get(key) != null) {
+            argumentBuf.append(name);
+            if(value != null) {
                 argumentBuf.append("="); // NOI18N
-                argumentBuf.append(keyValueArgs.get(key));
+                argumentBuf.append(value);
             }
         }
     }
diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV6_1_0.xml b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV6_1_0.xml
index c53f0d8..f68a7d2 100644
--- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV6_1_0.xml
+++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/GlassFishV6_1_0.xml
@@ -23,9 +23,9 @@
     <tools lib="lib">
         <asadmin jar="client/appserver-cli.jar"/>
     </tools>
-    <java version="1.8">
-        <platform version="1.7"/>
-        <platform version="1.8"/>
+    <java version="11">
+        <platform version="11"/>
+        <platform version="16"/>
     </java>
     <javaee version="1.8">
         <profile version="1.3" type="full"/>
diff --git a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java
index 25f0967..e562a84 100644
--- a/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java
+++ b/enterprise/glassfish.tooling/src/org/netbeans/modules/glassfish/tooling/server/config/JavaSEPlatform.java
@@ -44,11 +44,15 @@
     v1_5,
     /** JavaSE 1.6. */
     v1_6,
-    /** JavaEE 1.7. */
+    /** JavaSE 1.7. */
     v1_7,
-    /** JavaEE 1.8. */
-    v1_8;
-
+    /** JavaSE 1.8. */
+    v1_8,
+    /** JavaSE 11. */
+    v11,
+    /** JavaSE 16. */
+    v16;
+    
     ////////////////////////////////////////////////////////////////////////////
     // Class attributes                                                       //
     ////////////////////////////////////////////////////////////////////////////
@@ -83,6 +87,13 @@
     /**  A <code>String</code> representation of v1_8 value. */
     static final String V1_8_STR = "1.8";
 
+    /**  A <code>String</code> representation of v11 value. */
+    static final String V11_STR = "11";
+
+    /**  A <code>String</code> representation of v16 value. */
+    static final String V16_STR = "16";    
+    
+    
     /** 
      * Stored <code>String</code> values for backward <code>String</code>
      * conversion.
@@ -142,6 +153,9 @@
             case v1_6:     return V1_6_STR;
             case v1_7:     return V1_7_STR;
             case v1_8:     return V1_8_STR;
+            case v11:     return V11_STR;            
+            case v16:     return V16_STR;                   
+                        
             // This is unrecheable. Being here means this class does not handle
             // all possible values correctly.
             default:   throw new ServerConfigException(