8213166: jpackager --argument arg is broken JDK-8200758-branch
authorherrick
Wed, 31 Oct 2018 19:05:56 -0400
branchJDK-8200758-branch
changeset 57012 200666876601
parent 57011 7df1e4bf870a
child 57013 0ece1b6f0958
8213166: jpackager --argument arg is broken Reviewed-by: almatvee
src/jdk.packager/share/classes/jdk/packager/internal/AbstractBundler.java
src/jdk.packager/share/native/library/common/Helpers.cpp
--- a/src/jdk.packager/share/classes/jdk/packager/internal/AbstractBundler.java	Wed Oct 31 19:02:03 2018 -0400
+++ b/src/jdk.packager/share/classes/jdk/packager/internal/AbstractBundler.java	Wed Oct 31 19:05:56 2018 -0400
@@ -184,8 +184,10 @@
     @Override
     public void cleanup(Map<String, ? super Object> params) {
         try {
-            IOUtils.deleteRecursive(
-                    StandardBundlerParam.BUILD_ROOT.fetchFrom(params));
+            if (!Log.isDebug()) {
+                IOUtils.deleteRecursive(
+                        StandardBundlerParam.BUILD_ROOT.fetchFrom(params));
+            }
         } catch (IOException e) {
             Log.debug(e.getMessage());
         }
--- a/src/jdk.packager/share/native/library/common/Helpers.cpp	Wed Oct 31 19:02:03 2018 -0400
+++ b/src/jdk.packager/share/native/library/common/Helpers.cpp	Wed Oct 31 19:05:56 2018 -0400
@@ -30,7 +30,7 @@
 
 bool Helpers::SplitOptionIntoNameValue(
         TString option, TString& Name, TString& Value) {
-    bool result = false;
+    bool hasValue = false;
     Name = _T("");
     Value = _T("");
     unsigned int index = 0;
@@ -41,7 +41,7 @@
         switch (c) {
             case '=': {
                 index++;
-                result = true;
+                hasValue = true;
                 break;
             }
 
@@ -77,11 +77,11 @@
         break;
     }
 
-    if (result) {
+    if (hasValue) {
         Value = option.substr(index, index - option.length());
     }
 
-    return result;
+    return (option.length() > 0);
 }