Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
Description
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).
version = setDataRequest.getVersion(); int currentVersion = nodeRecord.stat.getVersion(); if (version != -1 && version != currentVersion) { throw new KeeperException.BadVersionException(path); } version = currentVersion + 1;
private static int checkAndIncVersion(int currentVersion, int versionToCompare, String path )