[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1220?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136934#comment-13136934
 ] 

kavita sharma commented on ZOOKEEPER-1220:
------------------------------------------

Hi Patrick,

i corrected the patch along with that
i have added some more testcases for zkcli.which i found as part of the 
correction.

thanks a lot.  
                
> ./zkCli.sh 'create' command is throwing ArrayIndexOutOfBoundsException
> ----------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1220
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1220
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 3.3.3
>            Reporter: kavita sharma
>            Assignee: kavita sharma
>             Fix For: 3.5.0
>
>         Attachments: ZOOKEEPER-1220.1.patch, ZOOKEEPER-1220.patch
>
>
> Few problems while executing create command,
>  
> If we will give command like 
>  
> 1)[zk: localhost:2181(CONNECTED) 0] create -s -e /node1
> {noformat}
>        Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
>       at 
> org.apache.zookeeper.ZooKeeperMain.processZKCmd(ZooKeeperMain.java:692)
>       at org.apache.zookeeper.ZooKeeperMain.processCmd(ZooKeeperMain.java:593)
>       at 
> org.apache.zookeeper.ZooKeeperMain.executeLine(ZooKeeperMain.java:365)
>       at org.apache.zookeeper.ZooKeeperMain.run(ZooKeeperMain.java:323)
>       at org.apache.zookeeper.ZooKeeperMain.main(ZooKeeperMain.java:282)
> {noformat}
>       but actually it should create emphemeral sequential node.
> 2)[zk: localhost:2181(CONNECTED) 0] create -s -e
> {noformat}
>     Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3
> {noformat}
>     here it should print the list of commands that is the default behaviour 
> of zkCli for invalid/incomplete commands.
> 3)[zk: localhost:2181(CONNECTED) 3] create -s -e "data"
> {noformat}
>      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
> {noformat}
>      here command is wrong so it should print list of commnads. . 
> 4)[zk: localhost:2181(CONNECTED) 0] create /node1
>     zkCli is treating it as a invalid command.because for args.length  check 
> (3)is their but behaviour is 
>     if user haven't given any of the option it should create persistent node.
>         {noformat}
>         if (cmd.equals("create") && args.length >= 3) {
>             int first = 0;
>             CreateMode flags = CreateMode.PERSISTENT;
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to