General Sonar clean-up
[ovsdb.git] / northbound / src / main / java / org / opendaylight / ovsdb / northbound / OvsdbNorthboundV2.java
index ec7b7b1708cb97d8cffd0cb7572cd98cb184965a..3dfd2ea945b0817d21fb44b6667bdf1c6943d798 100644 (file)
@@ -32,7 +32,6 @@ import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.controller.northbound.commons.RestMessages;
 import org.opendaylight.controller.northbound.commons.exception.BadRequestException;
-import org.opendaylight.controller.northbound.commons.exception.ResourceConflictException;
 import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
 import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
 import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
@@ -86,18 +85,6 @@ public class OvsdbNorthboundV2 {
         return username;
     }
 
-    private void handleNameMismatch(String name, String nameinURL) {
-        if (name == null || nameinURL == null) {
-            throw new BadRequestException(RestMessages.INVALIDDATA.toString() + " : Name is null");
-        }
-
-        if (name.equalsIgnoreCase(nameinURL)) {
-            return;
-        }
-        throw new ResourceConflictException(RestMessages.INVALIDDATA.toString()
-                + " : Table Name in URL does not match the row name in request body");
-    }
-
     /**
      * Create a Row for Open_vSwitch schema
      *
@@ -430,7 +417,7 @@ public class OvsdbNorthboundV2 {
         OvsdbClient client = connectionService.getConnection(node).getClient();
         String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
 
-        Row row = null;
+        Row row;
         try {
             row = ovsdbTable.getRow(node, bckCompatibleTableName, rowUuid);
         } catch (Exception e) {
@@ -512,7 +499,7 @@ public class OvsdbNorthboundV2 {
         Node node = connectionService.getNode(nodeId);
         OvsdbClient client = connectionService.getConnection(node).getClient();
         String bckCompatibleTableName = this.getBackwardCompatibleTableName(client, OvsVswitchdSchemaConstants.DATABASE_NAME, tableName);
-        Map<String, Row> rows = null;
+        Map<String, Row> rows;
         try {
             rows = ovsdbTable.getRows(node, bckCompatibleTableName);
         } catch (Exception e) {
@@ -593,7 +580,7 @@ public class OvsdbNorthboundV2 {
             return Response.status(Response.Status.BAD_REQUEST).build();
         }
 
-        Status status = ovsdbTable.updateRow(node, bckCompatibleTableName, localRow.getParentUuid(), rowUuid, localRow.getRow());
+        ovsdbTable.updateRow(node, bckCompatibleTableName, localRow.getParentUuid(), rowUuid, localRow.getRow());
         return NorthboundUtils.getResponse(
                 new org.opendaylight.controller.sal.utils.Status(
                         org.opendaylight.controller.sal.utils.StatusCode.SUCCESS));