Removed checkstyle warnings.
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / RIBTables.java
index e4ad31575c1a7b3084e3e2601ca5a8f7975ee603..d5db1cf9aaa00995fbc0ca133ecb774d9c8c83fc 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl;
 
+import com.google.common.base.Preconditions;
+
 import java.util.HashMap;
 import java.util.Map;
 
@@ -19,41 +21,39 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Preconditions;
-
 final class RIBTables {
 
-       private static final Logger LOG = LoggerFactory.getLogger(RIBTables.class);
-
-       private final Map<TablesKey, AdjRIBsIn> tables = new HashMap<>();
-       private final RIBExtensionConsumerContext registry;
-
-       RIBTables(final RIBExtensionConsumerContext extensions) {
-               this.registry = Preconditions.checkNotNull(extensions);
-       }
-
-       public synchronized AdjRIBsIn get(final TablesKey key) {
-               LOG.debug("Looking for key {} in tables {}", key, this.tables);
-               final AdjRIBsIn ret = this.tables.get(key);
-               LOG.trace("Key found {}", ret);
-               return ret;
-       }
-
-       public synchronized AdjRIBsIn create(final DataModificationTransaction trans, final RibReference rib, final TablesKey key) {
-               if (this.tables.containsKey(key)) {
-                       LOG.warn("Duplicate create request for key {}", key);
-                       return this.tables.get(key);
-               }
-
-               final AdjRIBsInFactory f = this.registry.getAdjRIBsInFactory(key.getAfi(), key.getSafi());
-               if (f == null) {
-                       LOG.debug("RIBsInFactory not found for key {}, returning null", key);
-                       return null;
-               }
-
-               final AdjRIBsIn table = Preconditions.checkNotNull(f.createAdjRIBsIn(trans, rib, key));
-               LOG.debug("Table {} created for key {}", table, key);
-               this.tables.put(key, table);
-               return table;
-       }
+    private static final Logger LOG = LoggerFactory.getLogger(RIBTables.class);
+
+    private final Map<TablesKey, AdjRIBsIn> tables = new HashMap<>();
+    private final RIBExtensionConsumerContext registry;
+
+    RIBTables(final RIBExtensionConsumerContext extensions) {
+        this.registry = Preconditions.checkNotNull(extensions);
+    }
+
+    public synchronized AdjRIBsIn get(final TablesKey key) {
+        LOG.debug("Looking for key {} in tables {}", key, this.tables);
+        final AdjRIBsIn ret = this.tables.get(key);
+        LOG.trace("Key found {}", ret);
+        return ret;
+    }
+
+    public synchronized AdjRIBsIn create(final DataModificationTransaction trans, final RibReference rib, final TablesKey key) {
+        if (this.tables.containsKey(key)) {
+            LOG.warn("Duplicate create request for key {}", key);
+            return this.tables.get(key);
+        }
+
+        final AdjRIBsInFactory f = this.registry.getAdjRIBsInFactory(key.getAfi(), key.getSafi());
+        if (f == null) {
+            LOG.debug("RIBsInFactory not found for key {}, returning null", key);
+            return null;
+        }
+
+        final AdjRIBsIn table = Preconditions.checkNotNull(f.createAdjRIBsIn(trans, rib, key));
+        LOG.debug("Table {} created for key {}", table, key);
+        this.tables.put(key, table);
+        return table;
+    }
 }