[ https://issues.apache.org/jira/browse/ZOOKEEPER-1226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128446#comment-13128446 ]
jirapos...@reviews.apache.org commented on ZOOKEEPER-1226: ---------------------------------------------------------- ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/2397/ ----------------------------------------------------------- Review request for zookeeper. Summary ------- > extract version check in separate method in PrepRequestProcessor > ---------------------------------------------------------------- > > Key: ZOOKEEPER-1226 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1226 > Project: ZooKeeper > Issue Type: Sub-task > Reporter: Thomas Koch > Assignee: Thomas Koch > Attachments: ZOOKEEPER-1226.patch > > > The following code is repeated 4 times and should be put in a method that > either throws the Exception or returns the incremented version (see below). > {code} > version = setDataRequest.getVersion(); > int currentVersion = nodeRecord.stat.getVersion(); > if (version != -1 && version != currentVersion) { > throw new KeeperException.BadVersionException(path); > } > version = currentVersion + 1; > {code} > {code} > private static int checkAndIncVersion(int currentVersion, int > versionToCompare, String path ) > {code} -- 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