Fix modernization issues
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / config / PrefixShardConfiguration.java
index 629418f99b1938d48062176658cc1f9b8a1c64da..dc6db2c6beeca669de540c1e2fa91ab4ac88844c 100644 (file)
@@ -5,10 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.controller.cluster.datastore.config;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.collect.ImmutableSet;
 import java.io.Externalizable;
 import java.io.IOException;
@@ -52,16 +52,17 @@ public class PrefixShardConfiguration implements Serializable {
 
         @Override
         public void readExternal(final ObjectInput objectInput) throws IOException, ClassNotFoundException {
-            final DOMDataTreeIdentifier prefix =  (DOMDataTreeIdentifier) objectInput.readObject();
-            final String strategyName = (String) objectInput.readObject();
+            final DOMDataTreeIdentifier localPrefix = (DOMDataTreeIdentifier) objectInput.readObject();
+            final String localStrategyName = (String) objectInput.readObject();
 
             final int size = objectInput.readInt();
-            final Collection<MemberName> shardMemberNames = new ArrayList<>(size);
+            final Collection<MemberName> localShardMemberNames = new ArrayList<>(size);
             for (int i = 0; i < size; i++) {
-                shardMemberNames.add(MemberName.readFrom(objectInput));
+                localShardMemberNames.add(MemberName.readFrom(objectInput));
             }
 
-            prefixShardConfiguration = new PrefixShardConfiguration(prefix, strategyName, shardMemberNames);
+            prefixShardConfiguration = new PrefixShardConfiguration(localPrefix, localStrategyName,
+                    localShardMemberNames);
         }
 
         private Object readResolve() {
@@ -78,8 +79,8 @@ public class PrefixShardConfiguration implements Serializable {
     public PrefixShardConfiguration(final DOMDataTreeIdentifier prefix,
                                     final String shardStrategyName,
                                     final Collection<MemberName> shardMemberNames) {
-        this.prefix = Preconditions.checkNotNull(prefix);
-        this.shardStrategyName = Preconditions.checkNotNull(shardStrategyName);
+        this.prefix = requireNonNull(prefix);
+        this.shardStrategyName = requireNonNull(shardStrategyName);
         this.shardMemberNames = ImmutableSet.copyOf(shardMemberNames);
     }