jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1551192 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
Date Mon, 16 Dec 2013 11:51:46 GMT
Author: chetanm
Date: Mon Dec 16 11:51:46 2013
New Revision: 1551192

URL: http://svn.apache.org/r1551192
Log:
OAK-1274: Wrong comparison for old Revisions

Making the fields as final and minor code cleanup

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java?rev=1551192&r1=1551191&r2=1551192&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
Mon Dec 16 11:51:46 2013
@@ -40,18 +40,18 @@ public class Revision {
      * revision, such that timestamps of revisions can only be compared if the
      * machine id is the same.
      */
-    private long timestamp;
+    private final long timestamp;
     
     /**
      * An incrementing counter, for commits that occur within the same
      * millisecond.
      */
-    private int counter;
+    private final int counter;
     
     /**
      * The cluster id (the MongoDB machine id).
      */
-    private int clusterId;
+    private final int clusterId;
 
     /**
      * Whether this is a branch revision.
@@ -194,8 +194,7 @@ public class Revision {
         int c = Integer.parseInt(t, 16);
         t = rev.substring(idxClusterId + 1);
         int clusterId = Integer.parseInt(t, 16);
-        Revision r = new Revision(timestamp, c, clusterId, isBranch);
-        return r;
+        return new Revision(timestamp, c, clusterId, isBranch);
     }
     
     @Override
@@ -204,6 +203,7 @@ public class Revision {
                 Integer.toHexString(counter) + '-' + Integer.toHexString(clusterId);
     }
     
+    @SuppressWarnings("UnusedDeclaration")
     public String toReadableString() {
         StringBuilder buff = new StringBuilder();
         buff.append("revision: \"").append(toString()).append("\"");



Mime
View raw message