You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by hustfxj <gi...@git.apache.org> on 2016/02/23 16:18:46 UTC
[GitHub] storm pull request: [STORM-1572] throw NPE when parsing the comman...
GitHub user hustfxj opened a pull request:
https://github.com/apache/storm/pull/1142
[STORM-1572] throw NPE when parsing the command line arguments by CLI
$ storm kill test
Running: /data/nfs_share/soft/jdk1.7.0_79/bin/java -client -Ddaemon.name= -Dstorm.options= -Dstorm.home=/data/nfs_share/soft/storm -Dstorm.log.dir=/home/admin/storm_logs -Djava.library.path=/usr/local/lib -Dstorm.conf.file= -cp /data/nfs_share/soft/storm/lib/servlet-api-2.5.jar:/data/nfs_share/soft/storm/lib/slf4j-api-1.7.7.jar:/data/nfs_share/soft/storm/lib/log4j-over-slf4j-1.6.6.jar:/data/nfs_share/soft/storm/lib/reflectasm-1.07-shaded.jar:/data/nfs_share/soft/storm/lib/log4j-api-2.1.jar:/data/nfs_share/soft/storm/lib/storm-core-2.0.0-SNAPSHOT.jar:/data/nfs_share/soft/storm/lib/log4j-core-2.1.jar:/data/nfs_share/soft/storm/lib/kryo-2.21.jar:/data/nfs_share/soft/storm/lib/clojure-1.7.0.jar:/data/nfs_share/soft/storm/lib/log4j-slf4j-impl-2.1.jar:/data/nfs_share/soft/storm/lib/minlog-1.2.jar:/data/nfs_share/soft/storm/lib/disruptor-3.3.2.jar:/data/nfs_share/soft/storm/lib/asm-4.0.jar:/home/admin/.storm:/data/nfs_share/soft/storm/bin org.apache.storm.command.KillTopology test
Exception in thread "main" java.lang.NullPointerException
at org.apache.storm.command.CLI$CLIBuilder.parse(CLI.java:243)
at org.apache.storm.command.KillTopology.main(KillTopology.java:33)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hustfxj/storm 0223
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/1142.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1142
----
commit 3af457f8cd3dec53af969a70f7f5238b4502dada
Author: xiaojian.fxj <xi...@alibaba-inc.com>
Date: 2016-02-23T15:11:44Z
fix CLI about parsing the command line arguments
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-1572] throw NPE when parsing the comman...
Posted by wuchong <gi...@git.apache.org>.
Github user wuchong commented on the pull request:
https://github.com/apache/storm/pull/1142#issuecomment-188100054
+1 except a minor comment
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-1572] throw NPE when parsing the comman...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/storm/pull/1142
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-1572] throw NPE when parsing the comman...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/1142#discussion_r53965439
--- Diff: storm-core/src/jvm/org/apache/storm/command/CLI.java ---
@@ -238,10 +238,13 @@ public CLIBuilder arg(String name, Parse parse, Assoc assoc) {
DefaultParser parser = new DefaultParser();
CommandLine cl = parser.parse(options, rawArgs);
HashMap<String, Object> ret = new HashMap<>();
- for (Opt opt: opts) {
+ for (Opt opt : opts) {
Object current = null;
- for (String val: cl.getOptionValues(opt.shortName)) {
- current = opt.process(current, val);
+ String[] strings = cl.getOptionValues(opt.shortName);
+ if (strings != null) {
+ for (String val : cl.getOptionValues(opt.shortName)) {
--- End diff --
The change is minor so I will do it as I merge it in.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-1572] throw NPE when parsing the comman...
Posted by revans2 <gi...@git.apache.org>.
Github user revans2 commented on the pull request:
https://github.com/apache/storm/pull/1142#issuecomment-187738243
+1 I guess I never did test without a -w option.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] storm pull request: [STORM-1572] throw NPE when parsing the comman...
Posted by wuchong <gi...@git.apache.org>.
Github user wuchong commented on a diff in the pull request:
https://github.com/apache/storm/pull/1142#discussion_r53898826
--- Diff: storm-core/src/jvm/org/apache/storm/command/CLI.java ---
@@ -238,10 +238,13 @@ public CLIBuilder arg(String name, Parse parse, Assoc assoc) {
DefaultParser parser = new DefaultParser();
CommandLine cl = parser.parse(options, rawArgs);
HashMap<String, Object> ret = new HashMap<>();
- for (Opt opt: opts) {
+ for (Opt opt : opts) {
Object current = null;
- for (String val: cl.getOptionValues(opt.shortName)) {
- current = opt.process(current, val);
+ String[] strings = cl.getOptionValues(opt.shortName);
+ if (strings != null) {
+ for (String val : cl.getOptionValues(opt.shortName)) {
--- End diff --
replace `cl.getOptionValues(opt.shortName)` with `strings` to avoid duplicate getOptionValues
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---