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

Thomas Koch commented on ZOOKEEPER-1199:
----------------------------------------

There are four places in the ZK code, that mapped OpCodes to string 
representations. One of them wasn't used anymore, two others represented the 
same mapping and the last one provided four letter representations. As you can 
see in the definition of the OpCode enum, there were strings missing for some 
newer added OpCodes. You might want to say, which strings I should put in?
I spotted an inconsistency in server/quorum/ReadOnlyRequestProcessor.java. 
There's a switch checking for a write operation which does not include multi, 
start- and stopsession. What is intended there?


> Make OpCode an enum
> -------------------
>
>                 Key: ZOOKEEPER-1199
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1199
>             Project: ZooKeeper
>          Issue Type: Sub-task
>            Reporter: Thomas Koch
>            Assignee: Thomas Koch
>         Attachments: ZOOKEEPER-1199.patch
>
>
> ZooDefs.OpCode is an interface with integer constants. Changing this to an 
> enum provides safety. See "Item 30: Use enums instead of int constants" in 
> Effective Java.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to