[ https://issues.apache.org/jira/browse/ZOOKEEPER-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130483#comment-13130483 ]
Thomas Koch commented on ZOOKEEPER-1235: ---------------------------------------- I forgot: public static KeeperException create(Code code) has another switch on the code to create a KeeperException instance. The Code enum should rather store the classes so that one can call Code.getExceptionClass.newInstance() > store KeeperException messages in the Code enum > ----------------------------------------------- > > Key: ZOOKEEPER-1235 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1235 > Project: ZooKeeper > Issue Type: Sub-task > Reporter: Thomas Koch > > Enums are just objects that can have properties. So instead of switching on > the code integer, the message can be stored in the enum. > OK( OK) becomes OK (Ok, "ok") > getCodeMessage(Code code) just returns code.getMessage() -- 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