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

Arshad Mohammad commented on ZOOKEEPER-2470:
--------------------------------------------

[~shralex], The fix looks good to me. Can you write a simple test case to test 
the scenario. My be you can include bellow test in the patch.
{code}
package org.apache.zookeeper.server;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class ServerConfigTest {
    @Test
    public void testParseStringArray() {
        ServerConfig config = new ServerConfig();
        long tickTime = 2000;
        String[] args = new String[] { "123", "dataDir", 
Long.toString(tickTime), "60" };
        config.parse(args);
        assertEquals(tickTime, config.tickTime);
    }
}
{code}

> ServerConfig#parse(String[])  ignores tickTime
> ----------------------------------------------
>
>                 Key: ZOOKEEPER-2470
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2470
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.4.7, 3.5.1
>            Reporter: Alexander Shraer
>            Assignee: Alexander Shraer
>            Priority: Trivial
>             Fix For: 3.4.9, 3.5.3
>
>         Attachments: ZOOKEEPER-2470.patch
>
>
> Based on bug report from ykgarfield:
> ServerConfig#parse(String[]) method has the following code:
>     public void parse(String[] args) {
>         ...
>         if (args.length == 3) {
>                 tickTime = Integer.parseInt(args[2]);
>         }
>         if (args.length == 4) {
>                 maxClientCnxns = Integer.parseInt(args[3]);
>         }
>     }
>     ```
> So if args.length == 4 tickTime isn't parsed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to