Fixing all but one sonar issues in NodeDatabase:Amended 01/20101/3
authorevvy <dhiraviam.natarajan@gmail.com>
Mon, 18 May 2015 13:08:07 +0000 (18:38 +0530)
committerevvy <dhiraviam.natarajan@gmail.com>
Mon, 18 May 2015 13:09:28 +0000 (18:39 +0530)
Need to fix UT scripts before using logger.

Change-Id: I8d48caefe7662d4ef721aef2b17f3eed048110e9
Signed-off-by: evvy <dhiraviam.natarajan@gmail.com>
plugin/src/main/java/org/opendaylight/ovsdb/plugin/internal/NodeDatabase.java

index ec1904c604793bf21b93077ae0ded6290550d56e..f086fd60505a4dbbc467defb6f09f94e9251a724 100644 (file)
@@ -24,13 +24,17 @@ public class NodeDatabase {
 
     public ConcurrentMap<String, ConcurrentMap<String, Row>> getDatabase(String dbName) {
         TableDB tdb = dbCache.get(dbName);
-        if (tdb == null) return null;
+        if (tdb == null) {
+           return null;
+        }
         return tdb.getTableCache();
     }
 
     public ConcurrentMap<String, Row> getTableCache(String dbName, String tableName) {
         ConcurrentMap<String, ConcurrentMap<String,Row>> tdbMap = getDatabase(dbName);
-        if (tdbMap == null) return null;
+        if (tdbMap == null) {
+           return null;
+        }
         return tdbMap.get(tableName);
     }
 
@@ -40,7 +44,9 @@ public class NodeDatabase {
 
     public Row getRow (String dbName, String tableName, String uuid) {
         ConcurrentMap<String, Row> tdb = this.getTableCache(dbName, tableName);
-        if (tdb == null) return null;
+        if (tdb == null) {
+           return null;
+        }
         return tdb.get(uuid);
     }
 
@@ -55,7 +61,9 @@ public class NodeDatabase {
 
     public void removeRow(String dbName, String tableName, String uuid) {
         TableDB db = dbCache.get(dbName);
-        if (db == null) return;
+        if (db == null) {
+           return;
+        }
         db.removeRow(tableName, uuid);
     }
 
@@ -63,7 +71,9 @@ public class NodeDatabase {
         for (String dbName : dbCache.keySet()) {
             System.out.println("Database "+dbName);
             ConcurrentMap<String, ConcurrentMap<String,Row>> tableDB = this.getDatabase(dbName);
-            if (tableDB == null) continue;
+            if (tableDB == null) {
+               continue;
+            }
             for (String tableName : tableDB.keySet()) {
                 ConcurrentMap<String, Row> tableRows = this.getTableCache(dbName, tableName);
                 System.out.println("\tTable "+tableName);
@@ -72,7 +82,9 @@ public class NodeDatabase {
                     Collection<Column> columns = row.getColumns();
                     System.out.print("\t\t"+uuid+ "==");
                     for (Column column : columns) {
-                        if (column.getData() != null) System.out.print(column.getSchema().getName()+" : "+ column.getData()+" ");
+                        if (column.getData() != null) {
+                           System.out.print(column.getSchema().getName()+" : "+ column.getData()+" ");
+                        }
                     }
                     System.out.println("");
                 }
@@ -124,4 +136,4 @@ public class NodeDatabase {
             MapUtils.debugPrint(System.out, null, cache);
         }
     }
-}
\ No newline at end of file
+}