You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/04/22 18:44:22 UTC

[3/6] git commit: Parse command line options as JSON values (STORM-173)

Parse command line options as JSON values (STORM-173)

Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/a0e2aa6e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/a0e2aa6e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/a0e2aa6e

Branch: refs/heads/master
Commit: a0e2aa6e37ddfd1174c3430499de2b18b34052c5
Parents: 442d8e7
Author: Danijel Schiavuzzi <da...@infobip.com>
Authored: Thu Apr 17 10:25:54 2014 +0200
Committer: Danijel Schiavuzzi <da...@infobip.com>
Committed: Thu Apr 17 10:25:54 2014 +0200

----------------------------------------------------------------------
 storm-core/src/jvm/backtype/storm/utils/Utils.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a0e2aa6e/storm-core/src/jvm/backtype/storm/utils/Utils.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/backtype/storm/utils/Utils.java b/storm-core/src/jvm/backtype/storm/utils/Utils.java
index bc0ba7e..2aa7b3e 100644
--- a/storm-core/src/jvm/backtype/storm/utils/Utils.java
+++ b/storm-core/src/jvm/backtype/storm/utils/Utils.java
@@ -172,13 +172,13 @@ public class Utils {
             commandOptions = commandOptions.replaceAll("%%%%", " ");
             String[] configs = commandOptions.split(",");
             for (String config : configs) {
-                String[] options = config.split("=");
+                String[] options = config.split("=", 2);
                 if (options.length == 2) {
-                    Object confValue = options[1];
-                    if (NumberUtils.isNumber(options[1])) {
-                        confValue = NumberUtils.createNumber(String.valueOf(confValue));
+                    Object val = JSONValue.parse(options[1]);
+                    if (val == null) {
+                        val = options[1];
                     }
-                    ret.put(options[0], confValue);
+                    ret.put(options[0], val);
                 }
             }
         }