From 0ee33ed493efa0ec367755151f91aa49f4f65e3e Mon Sep 17 00:00:00 2001
From: Robert Munteanu <rombert@apache.org>
Date: Tue, 29 Nov 2016 14:02:38 +0200
Subject: [PATCH] OAK-5183 - ClusterRepositoryInfo.getOrCreateId should
 explicitly check for a null argument

---
 .../jackrabbit/oak/plugins/identifier/ClusterRepositoryInfo.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/ClusterRepositoryInfo.java b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/ClusterRepositoryInfo.java
index 2ac756a..7b25282 100644
--- a/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/ClusterRepositoryInfo.java
+++ b/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/identifier/ClusterRepositoryInfo.java
@@ -16,9 +16,12 @@
  */
 package org.apache.jackrabbit.oak.plugins.identifier;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.UUID;
 
 import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Type;
@@ -55,7 +58,9 @@ public class ClusterRepositoryInfo {
      * @return the persistent clusterId
      */
     @CheckForNull
-    public static String getOrCreateId(NodeStore store) {
+    public static String getOrCreateId(@Nonnull NodeStore store) {
+        checkNotNull(store, "store is null");
+
         // first try to read an existing clusterId
         NodeState root = store.getRoot();
         NodeState node = root.getChildNode(CLUSTER_CONFIG_NODE);
-- 
2.10.2

