Author: stefanegli
Date: Wed Aug 26 13:23:22 2015
New Revision: 1697926

URL: http://svn.apache.org/r1697926
Log:
OAK-3289 : buglet fix for previous commit here : in case of RDBMK we get a Long 
but in case of Mongo we still get an Integer - so just do an ugly instanceof to 
support both until OAK-3288 is fixed

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java?rev=1697926&r1=1697925&r2=1697926&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterViewDocument.java
 Wed Aug 26 13:23:22 2015
@@ -447,7 +447,14 @@ class ClusterViewDocument {
         this.clusterViewId = (String) doc.get(CLUSTER_VIEW_ID_KEY);
         this.viewSeqNum = (Long) doc.get(VIEW_SEQ_NUM_KEY);
         this.createdAt = (String) doc.get(CREATED_KEY);
-        this.createdBy = (Long) doc.get(CREATOR_KEY);
+        Object creatorId = doc.get(CREATOR_KEY);
+        if (creatorId instanceof Long) {
+            this.createdBy = (Long) creatorId;
+        } else if (creatorId instanceof Integer) {
+            this.createdBy = (long)((Integer) creatorId);
+        } else {
+            throw new IllegalStateException("Unsupported type of creator: 
"+creatorId);
+        }
 
         Object obj = doc.get(ACTIVE_KEY);
         if (obj == null || !(obj instanceof String)) {


Reply via email to