negative integer arguments for operations are not supported

Bug #319908 reported by Jiaqi Guo
2
Affects Status Importance Assigned to Milestone
Jmxterm
Fix Released
Medium
Jiaqi Guo

Bug Description

This is a bug reported in sourceforge tracker https://sourceforge.net/tracker2/?func=detail&aid=2199303&group_id=91358&atid=596864. Original post is

I tried to use jmxterm to run a operation that requires using negative
numbers. The call fails with the following message.

This is using version 0.2 (uber jar)

>$ run scanLog -48 0
MalformedArgException:Apache Jakarta commons-cli couldn't parse arguments
[scanLog, -48, 0]

Thanks for your hard work, jmxterm is fantastic!

Revision history for this message
Jiaqi Guo (jiaqi) wrote :

Problem exists in current version. -123 confuses command parser since it can be an option named "123". I think such expression should be quot'ed

$>set Port -12345
org.cyclopsgroup.jcli.annotation.MalformedArgException: Apache Jakarta commons-cli couldn't parse arguments [Port, -12345]
        at org.cyclopsgroup.jcli.jccli.JakartaCommonsCliParser.parse(JakartaCommonsCliParser.java:98)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:158)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.doExecute(CommandCenter.java:140)
        at org.cyclopsgroup.jmxterm.cc.CommandCenter.execute(CommandCenter.java:194)
        at org.cyclopsgroup.jmxterm.boot.CliMain.execute(CliMain.java:148)
        at org.cyclopsgroup.jmxterm.boot.CliMain.main(CliMain.java:48)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:353)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:264)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.uberjar.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
        at org.codehaus.classworlds.uberjar.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -12345
        at org.apache.commons.cli.Parser.processOption(Parser.java:379)
        at org.apache.commons.cli.Parser.parse(Parser.java:193)
        at org.apache.commons.cli.Parser.parse(Parser.java:71)
        at org.cyclopsgroup.jcli.jccli.JakartaCommonsCliParser.parse(JakartaCommonsCliParser.java:94)
        ... 19 more

Changed in jmxterm:
assignee: nobody → jiaqi
status: New → In Progress
Jiaqi Guo (jiaqi)
Changed in jmxterm:
importance: Undecided → Medium
Revision history for this message
Jiaqi Guo (jiaqi) wrote :

Fix is committed as change http://cyclops-group.svn.sourceforge.net/viewvc/cyclops-group?view=rev&revision=2035
Negative number can be wrapped with double quot after this change

Changed in jmxterm:
status: In Progress → Fix Committed
Jiaqi Guo (jiaqi)
Changed in jmxterm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.