Update libary with checkstyle corrections 68/17268/1
authorSam Hague <shague@redhat.com>
Fri, 27 Mar 2015 23:45:49 +0000 (19:45 -0400)
committerSam Hague <shague@redhat.com>
Fri, 27 Mar 2015 23:45:49 +0000 (19:45 -0400)
Change-Id: I4408dd37290495a2df949ed538b9bf53090415a8
Signed-off-by: Sam Hague <shague@redhat.com>
52 files changed:
library/src/main/java/org/opendaylight/ovsdb/lib/MonitorCallBack.java
library/src/main/java/org/opendaylight/ovsdb/lib/MonitorHandle.java
library/src/main/java/org/opendaylight/ovsdb/lib/OvsdbClient.java
library/src/main/java/org/opendaylight/ovsdb/lib/OvsdbConnectionInfo.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/BadSchemaException.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/ColumnSchemaNotFoundException.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/InvalidEncodingException.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/SchemaVersionMismatchException.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/TableSchemaNotFoundException.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/TyperException.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/UnexpectedResultException.java
library/src/main/java/org/opendaylight/ovsdb/lib/error/UnsupportedArgumentException.java
library/src/main/java/org/opendaylight/ovsdb/lib/impl/ChannelConnectionHandler.java
library/src/main/java/org/opendaylight/ovsdb/lib/impl/FutureTransformUtils.java
library/src/main/java/org/opendaylight/ovsdb/lib/impl/OvsdbClientImpl.java
library/src/main/java/org/opendaylight/ovsdb/lib/impl/OvsdbConnectionService.java
library/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/ExceptionHandler.java
library/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpcDecoder.java
library/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpcEndpoint.java
library/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonRpcServiceBinderHandler.java
library/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/JsonUtils.java
library/src/main/java/org/opendaylight/ovsdb/lib/jsonrpc/Params.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/MonitorRequest.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/MonitorRequestBuilder.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/OvsdbRPC.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/TableUpdate.java
library/src/main/java/org/opendaylight/ovsdb/lib/message/TransactBuilder.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/Column.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/OvsdbMap.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/OvsdbSet.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/Row.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/UUID.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/Version.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/json/Converter.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/json/OvsdbMapSerializer.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/json/OvsdbSetSerializer.java
library/src/main/java/org/opendaylight/ovsdb/lib/notation/json/OvsdbTypesIdResolver.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Delete.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Insert.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Mutate.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Select.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/TransactionBuilder.java
library/src/main/java/org/opendaylight/ovsdb/lib/operations/Update.java
library/src/main/java/org/opendaylight/ovsdb/lib/osgi/Activator.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/BaseType.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/ColumnSchema.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/ColumnType.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/DatabaseSchema.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/GenericTableSchema.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/TableSchema.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/typed/TypedBaseTable.java
library/src/main/java/org/opendaylight/ovsdb/lib/schema/typed/TyperUtils.java

index 5e8127cf6066dbd876e0688a425ed95f8f5b7b41..58faea1d117c32affc057961e010c13558d91c99 100644 (file)
@@ -19,5 +19,5 @@ public interface MonitorCallBack {
 
     void update(TableUpdates result, DatabaseSchema dbSchema);
 
-    void exception(Throwable t);
+    void exception(Throwable throwable);
 }
index 2a15d984e23f539186120272eb542291aab40fef..06018725df2ebad87033b7d6d0821687655646cb 100644 (file)
@@ -14,8 +14,8 @@ package org.opendaylight.ovsdb.lib;
 
 import java.io.Serializable;
 
-public class MonitorHandle implements Serializable{
-   String id;
+public class MonitorHandle implements Serializable {
+    String id;
 
     public MonitorHandle(String id) {
         this.id = id;
index 34a0d2eb8bfd4f812606d93ed046df88f8a9c20b..b14f3b75ca62e3c933fa3c11c67b1575f7e61be9 100644 (file)
@@ -68,8 +68,9 @@ public interface OvsdbClient {
      *                       handle is used to later cancel ({@link #cancelMonitor(MonitorHandle)}) the monitor.
      * @param callback receives the monitor response
      */
-    public <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema schema, List<MonitorRequest<E>> monitorRequests,
-                                 MonitorCallBack callback);
+    public <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema schema,
+                                                           List<MonitorRequest<E>> monitorRequests,
+                                                           MonitorCallBack callback);
 
     /**
      * Cancels an existing monitor method.
@@ -118,7 +119,7 @@ public interface OvsdbClient {
 
     public void disconnect();
 
-    public DatabaseSchema getDatabaseSchema (String dbName);
+    public DatabaseSchema getDatabaseSchema(String dbName);
 
     /**
      * User friendly convenient methods that make use of TyperUtils.getTypedRowWrapper to create a Typed Row Proxy
@@ -142,9 +143,11 @@ public interface OvsdbClient {
      * User friendly convenient method to get a Typed Row Proxy given a Typed Table Class and the Row to be wrapped.
      *
      * @param klazz Typed Interface
-     * @param row The actual Row that the wrapper is operating on. It can be null if the caller is just interested in getting ColumnSchema.
+     * @param row The actual Row that the wrapper is operating on. It can be null if the caller
+     *            is just interested in getting ColumnSchema.
      * @return Proxy wrapper for the actual raw Row class.
      */
-    public <T extends TypedBaseTable<?>> T getTypedRowWrapper(final Class<T> klazz, final Row<GenericTableSchema> row);
+    public <T extends TypedBaseTable<?>> T getTypedRowWrapper(final Class<T> klazz,
+                                                              final Row<GenericTableSchema> row);
 
 }
index 77cca967f9a9efbe5422ba08221eb362b69c484f..c9a0045d502f656e93246afcb22aec22593ffb05 100644 (file)
@@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlTransient;
 
-@XmlRootElement(name="Connection")
+@XmlRootElement(name = "Connection")
 public class OvsdbConnectionInfo {
     public enum ConnectionType {
         ACTIVE, PASSIVE
@@ -38,27 +38,27 @@ public class OvsdbConnectionInfo {
         this.type = type;
     }
 
-    @XmlElement(name="remoteAddress")
+    @XmlElement(name = "remoteAddress")
     public InetAddress getRemoteAddress() {
         return ((InetSocketAddress)channel.remoteAddress()).getAddress();
     }
-    @XmlElement(name="remotePort")
+    @XmlElement(name = "remotePort")
     public int getRemotePort() {
         return ((InetSocketAddress)channel.remoteAddress()).getPort();
     }
-    @XmlElement(name="localAddress")
+    @XmlElement(name = "localAddress")
     public InetAddress getLocalAddress() {
         return ((InetSocketAddress)channel.localAddress()).getAddress();
     }
-    @XmlElement(name="localPort")
+    @XmlElement(name = "localPort")
     public int getLocalPort() {
         return ((InetSocketAddress)channel.localAddress()).getPort();
     }
-    @XmlElement(name="connectionType")
+    @XmlElement(name = "connectionType")
     public ConnectionType getType() {
         return type;
     }
-    @XmlElement(name="clientCertificate")
+    @XmlElement(name = "clientCertificate")
     public Certificate getCertificate() throws SSLPeerUnverifiedException {
         SslHandler sslHandler = (SslHandler) channel.pipeline().get("ssl");
         if (sslHandler != null) {
@@ -80,16 +80,20 @@ public class OvsdbConnectionInfo {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         OvsdbConnectionInfo other = (OvsdbConnectionInfo) obj;
         if (channel == null) {
-            if (other.channel != null)
+            if (other.channel != null) {
                 return false;
+            }
         } else if (!getRemoteAddress().equals(other.getRemoteAddress())) {
             return false;
         } else if (!getLocalAddress().equals(other.getLocalAddress())) {
@@ -99,17 +103,18 @@ public class OvsdbConnectionInfo {
         } else if (getLocalPort() != other.getLocalPort()) {
             return false;
         }
-        if (type != other.type)
+        if (type != other.type) {
             return false;
+        }
         return true;
     }
 
     @Override
     public String toString() {
-        return "ConnectionInfo [Remote-address=" + this.getRemoteAddress().getHostAddress() +
-                             ", Remote-port=" + this.getRemotePort() +
-                             ", Local-address" + this.getLocalAddress().getHostAddress() +
-                             ", Local-port=" + this.getLocalPort() +
-                             ", type=" + type + "]";
+        return "ConnectionInfo [Remote-address=" + this.getRemoteAddress().getHostAddress()
+                + ", Remote-port=" + this.getRemotePort()
+                + ", Local-address" + this.getLocalAddress().getHostAddress()
+                + ", Local-port=" + this.getLocalPort()
+                + ", type=" + type + "]";
     }
 }
index 7c420b32a2e6b51690a313806267ab5a31b1df40..6486a84c014a64a733721f8b0ceab11e97d1da04 100644 (file)
@@ -14,11 +14,11 @@ package org.opendaylight.ovsdb.lib.error;
  * BadSchema exception is thrown when the received schema is invalid
  */
 public class BadSchemaException extends RuntimeException {
-    public BadSchemaException(String message){
+    public BadSchemaException(String message) {
         super(message);
     }
 
-    public BadSchemaException(String message, Throwable cause){
+    public BadSchemaException(String message, Throwable cause) {
         super(message, cause);
     }
 
index 55169afcbb75486dcc2e618eeea3860782e29813..d71571251bde1bbf91a5a37b58b5977848c8be50 100644 (file)
@@ -15,7 +15,7 @@ package org.opendaylight.ovsdb.lib.error;
  */
 public class ColumnSchemaNotFoundException extends RuntimeException {
 
-    public ColumnSchemaNotFoundException(String message){
+    public ColumnSchemaNotFoundException(String message) {
         super(message);
     }
 
@@ -23,8 +23,8 @@ public class ColumnSchemaNotFoundException extends RuntimeException {
         super(message, cause);
     }
 
-    public static String createMessage(String columnName, String tableName){
-        String message = "Unable to locate ColumnSchema for "+  columnName + " in "+ tableName;
+    public static String createMessage(String columnName, String tableName) {
+        String message = "Unable to locate ColumnSchema for " +  columnName + " in " + tableName;
         return message;
     }
 
index 0709f67f551e33d70b941b093ed52275675cde3d..46ac93c172352469a2df9ba17bdf7b8602c8406c 100644 (file)
@@ -17,9 +17,9 @@ public class InvalidEncodingException extends RuntimeException {
     private final String actual;
 
     public InvalidEncodingException(String actual, String message) {
-          super(message);
-          this.actual = actual;
-      }
+        super(message);
+        this.actual = actual;
+    }
 
     public String getActual() {
         return actual;
index 8dceb13cc800ec196ea595f4c40027e2d69303db..07a6681dc3d6fdb79385fa150ea07cd7b277ebb4 100644 (file)
@@ -22,13 +22,14 @@ public class SchemaVersionMismatchException extends RuntimeException {
         super(message);
     }
 
-    public SchemaVersionMismatchException(String message, Throwable cause){
+    public SchemaVersionMismatchException(String message, Throwable cause) {
         super(message, cause);
     }
 
     public static String createMessage(Version currentVersion, Version requiredVersion) {
-        String message = "The schema version used to access this Table/Column does not match the required version.\n" +
-                "Current Version: " + currentVersion.toString() + "\n";
+        String message =
+                "The schema version used to access this Table/Column does not match the required version.\n"
+                + "Current Version: " + currentVersion.toString() + "\n";
 
         if (currentVersion.compareTo(requiredVersion) > 1) {
             message += "Removed in Version: " + requiredVersion.toString();
index f4fab967f7bf6b212aa91313332e51e2506ab66f..edd86aa26e904b695eeee7b54aa99a42c4c08c03 100644 (file)
@@ -15,7 +15,7 @@ package org.opendaylight.ovsdb.lib.error;
  */
 public class TableSchemaNotFoundException extends RuntimeException {
 
-    public TableSchemaNotFoundException(String message){
+    public TableSchemaNotFoundException(String message) {
         super(message);
     }
 
@@ -23,8 +23,8 @@ public class TableSchemaNotFoundException extends RuntimeException {
         super(message, cause);
     }
 
-    public static String createMessage(String tableName, String schemaName){
-        String message = "Unable to locate TableSchema for "+  tableName + " in "+ schemaName;
+    public static String createMessage(String tableName, String schemaName) {
+        String message = "Unable to locate TableSchema for " +  tableName + " in " + schemaName;
         return message;
     }
 
index 3b26cfdc4557a00774b6f84a694d88de781f8566..2028d29bf2f3b4a7588a972f4a6b446bb2b09a6c 100644 (file)
@@ -15,7 +15,7 @@ package org.opendaylight.ovsdb.lib.error;
  */
 public class TyperException extends RuntimeException {
 
-    public TyperException(String message){
+    public TyperException(String message) {
         super(message);
     }
 
index bbe4be12e02a2c4225b9f14b3541b4d1e149718d..9c8e01c9a9ae98ec91534641aae978c90c92d44a 100644 (file)
@@ -14,7 +14,7 @@ package org.opendaylight.ovsdb.lib.error;
  * This exception is thrown when a result does not meet any of the known formats in RFC7047
  */
 public class UnexpectedResultException extends RuntimeException {
-    public UnexpectedResultException(String message){
+    public UnexpectedResultException(String message) {
         super(message);
     }
 
index 7244654179fd30f90c577e3531f42b436eaf3773..3496655c15cecd3435d84ea9b0e62694bf1de67e 100644 (file)
@@ -12,11 +12,11 @@ package org.opendaylight.ovsdb.lib.error;
 
 public class UnsupportedArgumentException extends RuntimeException {
 
-    public UnsupportedArgumentException(String message){
+    public UnsupportedArgumentException(String message) {
         super(message);
     }
 
-   public UnsupportedArgumentException(String message, Throwable cause){
-       super(message, cause);
-   }
+    public UnsupportedArgumentException(String message, Throwable cause) {
+        super(message, cause);
+    }
 }
index 3c7a404a226c74b508319515e8ce6ce6f5f04b8d..ab3e82057cbb454359f0e34880a1c9d6f002392a 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.ovsdb.lib.OvsdbClient;
 
 public class ChannelConnectionHandler implements ChannelFutureListener {
     OvsdbClient client;
-    public ChannelConnectionHandler (OvsdbClient client) {
+    public ChannelConnectionHandler(OvsdbClient client) {
         this.client = client;
     }
     @Override
index 0123ed0a5778667f7f8f0e0b47d2dfc64de86da1..159f5d1bdc5bd8752d00885c424d0bd5c28d10ef 100644 (file)
@@ -26,15 +26,15 @@ import com.google.common.util.concurrent.ListenableFuture;
 public class FutureTransformUtils {
     private static final ObjectMapper objectMapper = new ObjectMapper();
 
-    public final static ListenableFuture<List<OperationResult>> transformTransactResponse
-            (ListenableFuture<List<JsonNode>> transactResponseFuture, final List<Operation> operations) {
+    public static final ListenableFuture<List<OperationResult>> transformTransactResponse(
+            ListenableFuture<List<JsonNode>> transactResponseFuture, final List<Operation> operations) {
         objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         return Futures.transform(transactResponseFuture, new Function<List<JsonNode>, List<OperationResult>>() {
             @Override
             public List<OperationResult> apply(List<JsonNode> jsonNodes) {
                 final List<OperationResult> operationResults = new ArrayList<>();
-                for (int i = 0; i < jsonNodes.size(); i++) {
-                    JsonNode jsonNode = jsonNodes.get(i);
+                for (int index = 0; index < jsonNodes.size(); index++) {
+                    JsonNode jsonNode = jsonNodes.get(index);
                     OperationResult or;
                     if (jsonNode != null && jsonNode.size() > 0) {
                         /*
@@ -50,18 +50,18 @@ public class FutureTransformUtils {
                          * json elements than the transaction operation request.
                          * Also handle that case by checking for i < operations.size().
                          */
-                        if (i < operations.size()) {
-                            Operation op = operations.get(i);
+                        if (index < operations.size()) {
+                            Operation op = operations.get(index);
                             switch (op.getOp()) {
-                            case "select":
-                                or = new OperationResult();
-                                or.setRows(op.getTableSchema().createRows(jsonNode));
-                                break;
+                                case "select":
+                                    or = new OperationResult();
+                                    or.setRows(op.getTableSchema().createRows(jsonNode));
+                                    break;
 
-                            default:
-                                or = objectMapper.convertValue(jsonNode, OperationResult.class);
+                                default:
+                                    or = objectMapper.convertValue(jsonNode, OperationResult.class);
 
-                                break;
+                                    break;
                             }
                         } else {
                             or = objectMapper.convertValue(jsonNode, OperationResult.class);
index b62e5596311218051c46fea25cdd078b68e9a62a..42de8d5b2de226e3d3f189fa18f7603c6fd9134c 100644 (file)
@@ -97,7 +97,8 @@ public class OvsdbClientImpl implements OvsdbClient {
                         logger.info("callback received with context {}, but no known handler. Ignoring!", key);
                         return;
                     }
-                    TableUpdates updates = _transformingCallback(updateNotification.getUpdates(), callbackContext.schema);
+                    TableUpdates updates = transformingCallback(updateNotification.getUpdates(),
+                            callbackContext.schema);
                     monitorCallBack.update(updates, callbackContext.schema);
                 }
 
@@ -117,12 +118,12 @@ public class OvsdbClientImpl implements OvsdbClient {
     }
 
 
-    protected TableUpdates _transformingCallback(JsonNode tableUpdatesJson, DatabaseSchema dbSchema) {
+    protected TableUpdates transformingCallback(JsonNode tableUpdatesJson, DatabaseSchema dbSchema) {
         //todo(ashwin): we should move all the JSON parsing logic to a utility class
         if (tableUpdatesJson instanceof ObjectNode) {
             Map<String, TableUpdate> tableUpdateMap = Maps.newHashMap();
             ObjectNode updatesJson = (ObjectNode) tableUpdatesJson;
-            for (Iterator<Map.Entry<String,JsonNode>> itr = updatesJson.fields(); itr.hasNext();){
+            for (Iterator<Map.Entry<String,JsonNode>> itr = updatesJson.fields(); itr.hasNext();) {
                 Map.Entry<String, JsonNode> entry = itr.next();
 
                 DatabaseSchema databaseSchema = this.schema.get(dbSchema.getName());
@@ -140,8 +141,8 @@ public class OvsdbClientImpl implements OvsdbClient {
 
         //todo, we may not need transactionbuilder if we can have JSON objects
         TransactBuilder builder = new TransactBuilder(dbSchema);
-        for (Operation o : operations) {
-            builder.addOperation(o);
+        for (Operation operation : operations) {
+            builder.addOperation(operation);
         }
 
         return FutureTransformUtils.transformTransactResponse(rpc.transact(builder), operations);
@@ -175,7 +176,7 @@ public class OvsdbClientImpl implements OvsdbClient {
         } catch (InterruptedException | ExecutionException e) {
             return null;
         }
-        TableUpdates updates = _transformingCallback(result, dbSchema);
+        TableUpdates updates = transformingCallback(result, dbSchema);
         return updates;
     }
 
@@ -248,10 +249,10 @@ public class OvsdbClientImpl implements OvsdbClient {
                         @Override
                         public DatabaseSchema apply(Map<String, DatabaseSchema> result) {
                             if (result.containsKey(database)) {
-                                DatabaseSchema s = result.get(database);
-                                s.populateInternallyGeneratedColumns();
-                                OvsdbClientImpl.this.schema.put(database, s);
-                                return s;
+                                DatabaseSchema dbSchema = result.get(database);
+                                dbSchema.populateInternallyGeneratedColumns();
+                                OvsdbClientImpl.this.schema.put(database, dbSchema);
+                                return dbSchema;
                             } else {
                                 return null;
                             }
@@ -265,11 +266,11 @@ public class OvsdbClientImpl implements OvsdbClient {
     private ListenableFuture<Map<String, DatabaseSchema>> getSchemaFromDevice(final List<String> dbNames) {
         Map<String, DatabaseSchema> schema = Maps.newHashMap();
         SettableFuture<Map<String, DatabaseSchema>> future = SettableFuture.create();
-        _populateSchema(dbNames, schema, future);
+        populateSchema(dbNames, schema, future);
         return future;
     }
 
-    private void _populateSchema(final List<String> dbNames,
+    private void populateSchema(final List<String> dbNames,
                                  final Map<String, DatabaseSchema> schema,
                                  final SettableFuture<Map<String, DatabaseSchema>> sfuture) {
 
@@ -284,7 +285,7 @@ public class OvsdbClientImpl implements OvsdbClient {
                         try {
                             schema.put(dbNames.get(0), DatabaseSchema.fromJson(dbNames.get(0), jsonNode));
                             if (schema.size() > 1 && !sfuture.isCancelled()) {
-                                _populateSchema(dbNames.subList(1, dbNames.size()), schema, sfuture);
+                                populateSchema(dbNames.subList(1, dbNames.size()), schema, sfuture);
                             } else if (schema.size() == 1) {
                                 sfuture.set(schema);
                             }
@@ -315,7 +316,7 @@ public class OvsdbClientImpl implements OvsdbClient {
     }
 
     @Override
-    public DatabaseSchema getDatabaseSchema (String dbName) {
+    public DatabaseSchema getDatabaseSchema(String dbName) {
         return schema.get(dbName);
     }
 
@@ -327,7 +328,7 @@ public class OvsdbClientImpl implements OvsdbClient {
      * @param klazz Typed Class that represents a Table
      * @return DatabaseSchema that matches a Typed Table Class
      */
-    private <T> DatabaseSchema getDatabaseSchemaForTypedTable (Class <T> klazz) {
+    private <T> DatabaseSchema getDatabaseSchemaForTypedTable(Class<T> klazz) {
         TypedTable typedTable = klazz.getAnnotation(TypedTable.class);
         if (typedTable != null) {
             return this.getDatabaseSchema(typedTable.database());
@@ -365,7 +366,8 @@ public class OvsdbClientImpl implements OvsdbClient {
      * User friendly convenient method to get a Typed Row Proxy given a Typed Table Class and the Row to be wrapped.
      *
      * @param klazz Typed Interface
-     * @param row The actual Row that the wrapper is operating on. It can be null if the caller is just interested in getting ColumnSchema.
+     * @param row The actual Row that the wrapper is operating on.
+     *            It can be null if the caller is just interested in getting ColumnSchema.
      * @return Proxy wrapper for the actual raw Row class.
      */
     @Override
index 8868ce3b6a99c1d39b8b9e0afb82051d846183f4..19a8c40946632bc2c1e4bf15d87b0df7aed1ef0e 100644 (file)
@@ -74,13 +74,13 @@ import com.google.common.collect.Sets;
  */
 public class OvsdbConnectionService implements OvsdbConnection {
     private static final Logger logger = LoggerFactory.getLogger(OvsdbConnectionService.class);
-    private final static int NUM_THREADS = 3;
+    private static final int NUM_THREADS = 3;
 
     // Singleton Service object that can be used in Non-OSGi environment
     private static Set<OvsdbConnectionListener> connectionListeners = Sets.newHashSet();
     private static Map<OvsdbClient, Channel> connections = Maps.newHashMap();
     private static OvsdbConnection connectionService;
-    private volatile static boolean singletonCreated = false;
+    private static volatile boolean singletonCreated = false;
 
     public static OvsdbConnection getService() {
         if (connectionService == null) {
@@ -108,7 +108,7 @@ public class OvsdbConnectionService implements OvsdbConnection {
                     if (sslContext != null) {
                         /* First add ssl handler if ssl context is given */
                         SSLEngine engine =
-                           sslContext.createSSLEngine(address.toString(), port);
+                            sslContext.createSSLEngine(address.toString(), port);
                         engine.setUseClientMode(true);
                         channel.pipeline().addLast("ssl", new SslHandler(engine));
                     }
@@ -122,7 +122,8 @@ public class OvsdbConnectionService implements OvsdbConnection {
 
             ChannelFuture future = bootstrap.connect(address, port).sync();
             Channel channel = future.channel();
-            OvsdbClient client = getChannelClient(channel, ConnectionType.ACTIVE, Executors.newFixedThreadPool(NUM_THREADS));
+            OvsdbClient client = getChannelClient(channel, ConnectionType.ACTIVE,
+                    Executors.newFixedThreadPool(NUM_THREADS));
             return client;
         } catch (InterruptedException e) {
             System.out.println("Thread was interrupted during connect");
@@ -132,7 +133,9 @@ public class OvsdbConnectionService implements OvsdbConnection {
 
     @Override
     public void disconnect(OvsdbClient client) {
-        if (client == null) return;
+        if (client == null) {
+            return;
+        }
         Channel channel = connections.get(client);
         if (channel != null) {
             channel.disconnect();
@@ -175,8 +178,7 @@ public class OvsdbConnectionService implements OvsdbConnection {
      * be overridden using the ovsdb.listenPort system property.
      */
     @Override
-    synchronized
-    public boolean startOvsdbManager(final int ovsdbListenPort) {
+    public synchronized boolean startOvsdbManager(final int ovsdbListenPort) {
         if (!singletonCreated) {
             new Thread() {
                 @Override
@@ -197,8 +199,7 @@ public class OvsdbConnectionService implements OvsdbConnection {
      * 6640 which can be overridden using the ovsdb.listenPort system property.
      */
     @Override
-    synchronized
-    public boolean startOvsdbManagerWithSsl(final int ovsdbListenPort,
+    public synchronized boolean startOvsdbManagerWithSsl(final int ovsdbListenPort,
                                      final SSLContext sslContext) {
         if (!singletonCreated) {
             new Thread() {
@@ -230,36 +231,37 @@ public class OvsdbConnectionService implements OvsdbConnection {
         EventLoopGroup bossGroup = new NioEventLoopGroup();
         EventLoopGroup workerGroup = new NioEventLoopGroup();
         try {
-            ServerBootstrap b = new ServerBootstrap();
-            b.group(bossGroup, workerGroup)
-             .channel(NioServerSocketChannel.class)
-             .option(ChannelOption.SO_BACKLOG, 100)
-             .handler(new LoggingHandler(LogLevel.INFO))
-             .childHandler(new ChannelInitializer<SocketChannel>() {
-                 @Override
-                 public void initChannel(SocketChannel channel) throws Exception {
-                     logger.debug("New Passive channel created : "+ channel.toString());
-                     if (sslContext != null) {
-                         /* Add SSL handler first if SSL context is provided */
-                         SSLEngine engine = sslContext.createSSLEngine();
-                         engine.setUseClientMode(false); // work in a server mode
-                         engine.setNeedClientAuth(true); // need client authentication
-                         channel.pipeline().addLast("ssl", new SslHandler(engine));
-                     }
+            ServerBootstrap serverBootstrap = new ServerBootstrap();
+            serverBootstrap.group(bossGroup, workerGroup)
+                    .channel(NioServerSocketChannel.class)
+                    .option(ChannelOption.SO_BACKLOG, 100)
+                    .handler(new LoggingHandler(LogLevel.INFO))
+                    .childHandler(new ChannelInitializer<SocketChannel>() {
+                        @Override
+                        public void initChannel(SocketChannel channel) throws Exception {
+                            logger.debug("New Passive channel created : {}", channel);
+                            if (sslContext != null) {
+                                /* Add SSL handler first if SSL context is provided */
+                                SSLEngine engine = sslContext.createSSLEngine();
+                                engine.setUseClientMode(false); // work in a server mode
+                                engine.setNeedClientAuth(true); // need client authentication
+                                channel.pipeline().addLast("ssl", new SslHandler(engine));
+                            }
 
-                     channel.pipeline().addLast(
-                             new JsonRpcDecoder(100000),
-                             new StringEncoder(CharsetUtil.UTF_8),
-                             new ExceptionHandler());
+                            channel.pipeline().addLast(
+                                 new JsonRpcDecoder(100000),
+                                 new StringEncoder(CharsetUtil.UTF_8),
+                                 new ExceptionHandler());
 
-                     handleNewPassiveConnection(channel);
-                 }
-             });
-            b.option(ChannelOption.TCP_NODELAY, true);
-            b.option(ChannelOption.RCVBUF_ALLOCATOR, new AdaptiveRecvByteBufAllocator(65535, 65535, 65535));
+                            handleNewPassiveConnection(channel);
+                        }
+                    });
+            serverBootstrap.option(ChannelOption.TCP_NODELAY, true);
+            serverBootstrap.option(ChannelOption.RCVBUF_ALLOCATOR,
+                    new AdaptiveRecvByteBufAllocator(65535, 65535, 65535));
             // Start the server.
-            ChannelFuture f = b.bind(port).sync();
-            Channel serverListenChannel =  f.channel();
+            ChannelFuture channelFuture = serverBootstrap.bind(port).sync();
+            Channel serverListenChannel = channelFuture.channel();
             // Wait until the server socket is closed.
             serverListenChannel.closeFuture().sync();
         } catch (InterruptedException e) {
@@ -276,7 +278,8 @@ public class OvsdbConnectionService implements OvsdbConnection {
         executorService.execute(new Runnable() {
             @Override
             public void run() {
-                OvsdbClient client = getChannelClient(channel, ConnectionType.PASSIVE, Executors.newFixedThreadPool(NUM_THREADS));
+                OvsdbClient client = getChannelClient(channel, ConnectionType.PASSIVE,
+                        Executors.newFixedThreadPool(NUM_THREADS));
 
                 SslHandler sslHandler = (SslHandler) channel.pipeline().get("ssl");
                 if (sslHandler != null) {
index 1a708f92c15b5fc63fb8f06e8d123a5ed81867d0..8efbf2163060754226d8b34549c376ffe74be172 100644 (file)
@@ -21,13 +21,13 @@ public class ExceptionHandler extends ChannelHandlerAdapter {
     @Override
     public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
         if ((cause instanceof InvalidEncodingException)
-                || (cause instanceof TooLongFrameException)){
+                || (cause instanceof TooLongFrameException)) {
             ctx.channel().disconnect();
         }
         /* In cases where a connection is quickly established and the closed
         Catch the IOException and close the channel
          */
-        if (cause instanceof IOException){
+        if (cause instanceof IOException) {
             ctx.channel().close();
         }
     }
index a02b6824647718f061290e003dedc486913c0918..6f6923dffc3c9ad83847ee95fc9aeae29c0cfd84 100644 (file)
@@ -86,24 +86,31 @@ public class JsonRpcDecoder extends ByteToMessageDecoder {
             }
         }
 
-        int i = lastRecordBytes + buf.readerIndex();
+        int index = lastRecordBytes + buf.readerIndex();
 
-        for (; i < buf.writerIndex(); i++) {
-            switch (buf.getByte(i)) {
+        for (; index < buf.writerIndex(); index++) {
+            switch (buf.getByte(index)) {
                 case '{':
-                    if (!inS) leftCurlies++;
+                    if (!inS) {
+                        leftCurlies++;
+                    }
                     break;
                 case '}':
-                    if (!inS) rightCurlies++;
+                    if (!inS) {
+                        rightCurlies++;
+                    }
                     break;
-                case '"': {
-                    if (buf.getByte(i - 1) != '\\') inS = !inS;
+                case '"':
+                    if (buf.getByte(index - 1) != '\\') {
+                        inS = !inS;
+                    }
+                    break;
+                default:
                     break;
-                }
             }
 
             if (leftCurlies != 0 && leftCurlies == rightCurlies && !inS) {
-                ByteBuf slice = buf.readSlice(1 + i - buf.readerIndex());
+                ByteBuf slice = buf.readSlice(1 + index - buf.readerIndex());
                 JsonParser jp = jacksonJsonFactory.createParser(new ByteBufInputStream(slice));
                 JsonNode root = jp.readValueAsTree();
                 out.add(root);
@@ -112,13 +119,13 @@ public class JsonRpcDecoder extends ByteToMessageDecoder {
                 break;
             }
 
-            if (i - buf.readerIndex() >= maxFrameLength) {
-                fail(ctx, i - buf.readerIndex());
+            if (index - buf.readerIndex() >= maxFrameLength) {
+                fail(ctx, index - buf.readerIndex());
             }
         }
 
         // end of stream, save the incomplete record index to avoid reexamining the whole on next run
-        if (i >= buf.writerIndex()) {
+        if (index >= buf.writerIndex()) {
             lastRecordBytes = buf.readableBytes();
             return;
         }
@@ -128,13 +135,13 @@ public class JsonRpcDecoder extends ByteToMessageDecoder {
         return recordsRead;
     }
 
-    private static void skipSpaces(ByteBuf b) throws IOException {
-        while (b.isReadable()) {
-            int ch = b.getByte(b.readerIndex()) & 0xFF;
+    private static void skipSpaces(ByteBuf byteBuf) throws IOException {
+        while (byteBuf.isReadable()) {
+            int ch = byteBuf.getByte(byteBuf.readerIndex()) & 0xFF;
             if (!(ch == ' ' || ch == '\r' || ch == '\n' || ch == '\t')) {
                 return;
             } else {
-                b.readByte(); //move the read index
+                byteBuf.readByte(); //move the read index
             }
         }
     }
@@ -145,13 +152,15 @@ public class JsonRpcDecoder extends ByteToMessageDecoder {
     }
 
     private void print(ByteBuf buf, int startPos, int chars, String message) {
-        if (null == message) message = "";
+        if (null == message) {
+            message = "";
+        }
         if (startPos > buf.writerIndex()) {
             logger.trace("startPos out of bounds");
         }
-        byte[] b = new byte[startPos + chars <= buf.writerIndex() ? chars : buf.writerIndex() - startPos];
-        buf.getBytes(startPos, b);
-        logger.trace("{} ={}", message, new String(b));
+        byte[] bytes = new byte[startPos + chars <= buf.writerIndex() ? chars : buf.writerIndex() - startPos];
+        buf.getBytes(startPos, bytes);
+        logger.trace("{} ={}", message, new String(bytes));
     }
 
     // copied from Netty decoder
@@ -159,13 +168,11 @@ public class JsonRpcDecoder extends ByteToMessageDecoder {
         if (frameLength > 0) {
             ctx.fireExceptionCaught(
                     new TooLongFrameException(
-                            "frame length exceeds " + maxFrameLength +
-                                    ": " + frameLength + " - discarded"));
+                            "frame length exceeds " + maxFrameLength + ": " + frameLength + " - discarded"));
         } else {
             ctx.fireExceptionCaught(
                     new TooLongFrameException(
-                            "frame length exceeds " + maxFrameLength +
-                                    " - discarding"));
+                            "frame length exceeds " + maxFrameLength + " - discarding"));
         }
     }
 }
index bdd9adab80b679ef6d7f9979cf6dda3a02784375..d90a5d648b865c667ed2f10b85e8439176754a9f 100644 (file)
@@ -80,7 +80,9 @@ public class JsonRpcEndpoint {
             @Override
             public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                 if (method.getName().equals(OvsdbRPC.REGISTER_CALLBACK_METHOD)) {
-                    if ((args == null) || args.length != 1 || !(args[0] instanceof OvsdbRPC.Callback)) return false;
+                    if ((args == null) || args.length != 1 || !(args[0] instanceof OvsdbRPC.Callback)) {
+                        return false;
+                    }
                     requestCallbacks.put(context, (OvsdbRPC.Callback)args[0]);
                     return true;
                 }
@@ -105,13 +107,13 @@ public class JsonRpcEndpoint {
                     }
                 }
 
-                String s = objectMapper.writeValueAsString(request);
-                logger.trace("getClient Request : {}", s);
+                String requestString = objectMapper.writeValueAsString(request);
+                logger.trace("getClient Request : {}", requestString);
 
                 SettableFuture<Object> sf = SettableFuture.create();
                 methodContext.put(request.getId(), new CallContext(request, method, sf));
 
-                nettyChannel.writeAndFlush(s);
+                nettyChannel.writeAndFlush(requestString);
 
                 return sf;
             }
@@ -123,13 +125,15 @@ public class JsonRpcEndpoint {
 
         logger.trace("Response : {}", response.toString());
         CallContext returnCtxt = methodContext.get(response.get("id").asText());
-        if (returnCtxt == null) return;
+        if (returnCtxt == null) {
+            return;
+        }
 
         if (ListenableFuture.class == returnCtxt.getMethod().getReturnType()) {
             TypeToken<?> retType = TypeToken.of(
                     returnCtxt.getMethod().getGenericReturnType())
                     .resolveType(ListenableFuture.class.getMethod("get").getGenericReturnType());
-            JavaType javaType =  TypeFactory.defaultInstance().constructType (retType.getType());
+            JavaType javaType =  TypeFactory.defaultInstance().constructType(retType.getType());
 
             JsonNode result = response.get("result");
             Object result1 = objectMapper.convertValue(result, javaType);
@@ -152,17 +156,17 @@ public class JsonRpcEndpoint {
         OvsdbRPC.Callback callback = requestCallbacks.get(context);
         if (callback != null) {
             Method[] methods = callback.getClass().getDeclaredMethods();
-            for (Method m : methods) {
-                if (m.getName().equals(request.getMethod())) {
-                    Class<?>[] parameters = m.getParameterTypes();
+            for (Method method : methods) {
+                if (method.getName().equals(request.getMethod())) {
+                    Class<?>[] parameters = method.getParameterTypes();
                     JsonNode params = requestJson.get("params");
                     Object param = objectMapper.convertValue(params, parameters[1]);
                     try {
-                        Invokable from = Invokable.from(m);
+                        Invokable from = Invokable.from(method);
                         from.setAccessible(true);
                         from.invoke(callback, context, param);
                     } catch (IllegalAccessException | InvocationTargetException e) {
-                        logger.error("Unable to invoke callback " + m.getName(), e);
+                        logger.error("Unable to invoke callback " + method.getName(), e);
                     }
                     return;
                 }
@@ -174,12 +178,12 @@ public class JsonRpcEndpoint {
         if (request.getMethod().equals("echo")) {
             JsonRpc10Response response = new JsonRpc10Response(request.getId());
             response.setError(null);
-            String s = null;
+            String jsonString = null;
             try {
-                s = objectMapper.writeValueAsString(response);
-                nettyChannel.writeAndFlush(s);
+                jsonString = objectMapper.writeValueAsString(response);
+                nettyChannel.writeAndFlush(jsonString);
             } catch (JsonProcessingException e) {
-                logger.error("Exception while processing JSON string " + s, e );
+                logger.error("Exception while processing JSON string " + jsonString, e );
             }
             return;
         }
index 171d3add24efe230ecf6476939ca31cc90852e13..97436a1e49c466410d907fe5951609b5d7397af1 100644 (file)
@@ -55,7 +55,7 @@ public class JsonRpcServiceBinderHandler extends ChannelInboundHandlerAdapter {
                        ChannelRead is a method invoked during Netty message receive event.
                        The only sane thing we can do is to print a meaningful error message.
                      */
-                    logger.error("NoSuchMethodException when handling "+msg.toString(), e);
+                    logger.error("NoSuchMethodException when handling {}", msg, e);
                 }
             } else if (jsonNode.hasNonNull("method")) {
                 if (jsonNode.has("id") && !Strings.isNullOrEmpty(jsonNode.get("id").asText())) {
index ca730ae557d449cc0884998a798afad6154c23bd..484c79e34a5e656bb61e8c582a757d7c3b7859d3 100644 (file)
@@ -20,7 +20,7 @@ public class JsonUtils {
 
     static ObjectWriter prettyWriter = mapper.writerWithDefaultPrettyPrinter();
 
-    public static String prettyString(Object jsonNode){
+    public static String prettyString(Object jsonNode) {
         try {
             return prettyWriter.writeValueAsString(jsonNode);
         } catch (JsonProcessingException e) {
index a8610f929b67b69dbdda877eb523b5faf024ae7d..ddb0054aa0dfd897b6e579edc71e46c777266b22 100644 (file)
@@ -12,5 +12,5 @@ package org.opendaylight.ovsdb.lib.jsonrpc;
 import java.util.List;
 
 public interface Params {
-   List<Object> params();
+    List<Object> params();
 }
index 109162ea7dc52c4e26cffa9d2272b4c549d94426..15480b71cd4bc42d24457069881b6f61469f43c9 100644 (file)
@@ -1,11 +1,9 @@
 /*
- * Copyright (C) 2013 EBay Software Foundation
+ * Copyright (C) 2013 EBay Software Foundation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Authors : Ashwin Raveendran, Madhu Venugopal
  */
 package org.opendaylight.ovsdb.lib.message;
 
@@ -17,6 +15,11 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.google.common.collect.Sets;
 
+/**
+ * @author Ashwin Raveendran
+ * @author Madhu Venugopal
+ * @param <E> monitor
+ */
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class MonitorRequest<E extends TableSchema<E>> {
     @JsonIgnore String tableName;
index 2d563557c8f0082bf39fdf83f186999996149f98..4fdf6d65b9ea32c9443065c91ca54f34abb2c8b4 100644 (file)
@@ -46,7 +46,7 @@ public class MonitorRequestBuilder<E extends TableSchema<E>> {
     }
 
     public MonitorRequestBuilder<E> addColumns(List<ColumnSchema<E, ?>> columns) {
-        for(ColumnSchema<E, ?> schema : columns) {
+        for (ColumnSchema<E, ?> schema : columns) {
             this.addColumn(schema);
         }
         return this;
index c108ce5cf4920126e891c92be8988997bf6b4248..2fe6bca398f89ed6d67a8f21165cbbd3ed717506 100644 (file)
@@ -19,7 +19,7 @@ public interface OvsdbRPC {
     public static final String REGISTER_CALLBACK_METHOD = "registerCallback";
 
     //public ListenableFuture<DatabaseSchema> get_schema(List<String> db_names);
-    public ListenableFuture<JsonNode> get_schema(List<String> db_names);
+    public ListenableFuture<JsonNode> get_schema(List<String> dbNames);
 
     public ListenableFuture<List<String>> echo();
 
@@ -31,7 +31,7 @@ public interface OvsdbRPC {
 
     public ListenableFuture<Response> cancel(String id);
 
-    public ListenableFuture<Object> monitor_cancel(Object json_value);
+    public ListenableFuture<Object> monitor_cancel(Object jsonValue);
 
     public ListenableFuture<Object> lock(List<String> id);
 
index 6895ee4a07c00123fbacc526cacaec4af533e060..e7176f2933317dccfb885ae7fbaa0d72f50b6e8b 100644 (file)
@@ -27,15 +27,15 @@ public class TableUpdate<E extends TableSchema<E>> {
         return rows;
     }
 
-    public class RowUpdate <E extends TableSchema<E>> {
+    public class RowUpdate<E extends TableSchema<E>> {
         private UUID uuid;
-        private Row<E> old;
-        private Row<E> new_;
+        private Row<E> oldRow;
+        private Row<E> newRow;
 
-        public RowUpdate (UUID uuid, Row<E> old, Row<E> new_) {
+        public RowUpdate(UUID uuid, Row<E> oldRow, Row<E> newRow) {
             this.uuid = uuid;
-            this.old = old;
-            this.new_ = new_;
+            this.oldRow = oldRow;
+            this.newRow = newRow;
         }
 
         public UUID getUuid() {
@@ -43,24 +43,24 @@ public class TableUpdate<E extends TableSchema<E>> {
         }
 
         public Row<E> getOld() {
-            return old;
+            return oldRow;
         }
 
-        public void setOld(Row<E> old) {
-            this.old = old;
+        public void setOld(Row<E> oldRow) {
+            this.oldRow = oldRow;
         }
 
         public Row<E> getNew() {
-            return new_;
+            return newRow;
         }
 
-        public void setNew(Row<E> new_) {
-            this.new_ = new_;
+        public void setNew(Row<E> newRow) {
+            this.newRow = newRow;
         }
 
         @Override
         public String toString() {
-            return "RowUpdate [uuid=" + uuid + ", old=" + old + ", new_=" + new_
+            return "RowUpdate [uuid=" + uuid + ", oldRow=" + oldRow + ", newRow=" + newRow
                     + "]";
         }
     }
@@ -70,19 +70,23 @@ public class TableUpdate<E extends TableSchema<E>> {
         rows = Maps.newHashMap();
     }
 
-    public void addRow(UUID uuid, Row<E> old, Row<E> new_) {
-        rows.put(uuid, new RowUpdate<E>(uuid, old, new_));
+    public void addRow(UUID uuid, Row<E> oldRow, Row<E> newRow) {
+        rows.put(uuid, new RowUpdate<E>(uuid, oldRow, newRow));
     }
 
     public Row<E> getOld(UUID uuid) {
         RowUpdate<E> rowUpdate = rows.get(uuid);
-        if (rowUpdate == null) return null;
+        if (rowUpdate == null) {
+            return null;
+        }
         return rowUpdate.getOld();
     }
 
     public Row<E> getNew(UUID uuid) {
         RowUpdate<E> rowUpdate = rows.get(uuid);
-        if (rowUpdate == null) return null;
+        if (rowUpdate == null) {
+            return null;
+        }
         return rowUpdate.getNew();
     }
 
index 07a5a175cdc9abbf2fbbdde62c5bac0151772c30..7a92dd470f9435deef9a0e1156789fc9294c1aae 100644 (file)
@@ -21,7 +21,7 @@ public class TransactBuilder implements Params {
 
     List<Operation> requests = Lists.newArrayList();
     DatabaseSchema dbSchema;
-    public TransactBuilder (DatabaseSchema dbSchema) {
+    public TransactBuilder(DatabaseSchema dbSchema) {
         this.dbSchema = dbSchema;
     }
 
@@ -36,11 +36,11 @@ public class TransactBuilder implements Params {
         return lists;
     }
 
-    public void addOperations (List<Operation> o) {
-        requests.addAll(o);
+    public void addOperations(List<Operation> operation) {
+        requests.addAll(operation);
     }
 
-    public void addOperation (Operation o) {
-        requests.add(o);
+    public void addOperation(Operation operation) {
+        requests.add(operation);
     }
 }
index fb24d9bf64032d499d9f32a5712bcac86dddd241..fa50aeb316b0d7c9512b5062da45b5214bbc01d4 100644 (file)
@@ -24,9 +24,9 @@ public class Column<E extends TableSchema<E>, D> {
     private ColumnSchema<E, D> schema;
     private D data;
 
-    public Column(ColumnSchema<E, D> schema, D d) {
+    public Column(ColumnSchema<E, D> schema, D data) {
         this.schema = schema;
-        this.data = d;
+        this.data = data;
     }
 
     public <E extends TableSchema<E>, T> T getData(ColumnSchema<E, T> schema) {
@@ -51,7 +51,7 @@ public class Column<E extends TableSchema<E>, D> {
 
     @Override
     public String toString() {
-        return "["+schema.getName() + "=" + data + "]";
+        return "[" + schema.getName() + "=" + data + "]";
     }
 
     @Override
@@ -65,23 +65,30 @@ public class Column<E extends TableSchema<E>, D> {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         Column other = (Column) obj;
         if (data == null) {
-            if (other.data != null)
+            if (other.data != null) {
                 return false;
-        } else if (!data.equals(other.data))
+            }
+        } else if (!data.equals(other.data)) {
             return false;
+        }
         if (schema == null) {
-            if (other.schema != null)
+            if (other.schema != null) {
                 return false;
-        } else if (!schema.equals(other.schema))
+            }
+        } else if (!schema.equals(other.schema)) {
             return false;
+        }
         return true;
     }
 }
index 210ec652291bef7d6ae8a6a6c48b4538de064c16..35fa4eb02e95bfc896fba9af25c89227e1c6d76a 100644 (file)
@@ -38,7 +38,7 @@ public class OvsdbMap<K, V> extends ForwardingMap<K, V> {
         return target;
     }
 
-    public static<K,V> OvsdbMap<K,V> fromMap(Map<K, V> value) {
+    public static <K,V> OvsdbMap<K,V> fromMap(Map<K, V> value) {
         return new OvsdbMap<K,V>(value);
     }
 }
index 03d12285c079cdff7a377314b4cc68953c92056a..f67a8bdf3e7006f5fa4e9f98e9676de47a170844 100644 (file)
@@ -30,7 +30,7 @@ public class OvsdbSet<T> extends ForwardingSet<T> {
     }
 
     public OvsdbSet(Set<T> backing) {
-       this.target = backing;
+        this.target = backing;
     }
 
     @Override
@@ -38,7 +38,7 @@ public class OvsdbSet<T> extends ForwardingSet<T> {
         return target;
     }
 
-    public static<D> OvsdbSet<D> fromSet(Set<D> value) {
+    public static <D> OvsdbSet<D> fromSet(Set<D> value) {
         return new OvsdbSet<>(value);
     }
 }
index 1d813fd4040482f9c9918cac32d2f79ea5920234..9fddf553bad24564cde806461d5282d1d7bdfb8e 100644 (file)
@@ -94,18 +94,23 @@ public class Row<E extends TableSchema<E>> {
      */
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         Row other = (Row) obj;
         if (columns == null) {
-            if (other.columns != null)
+            if (other.columns != null) {
                 return false;
-        } else if (!columns.equals(other.columns))
+            }
+        } else if (!columns.equals(other.columns)) {
             return false;
+        }
         return true;
     }
 }
index 0d032afdd1b50b06c4986ec54f94d2c7a3e9af45..910e4195430aae355864ed484a6ca66d2120c6b2 100644 (file)
@@ -42,18 +42,23 @@ public class UUID {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         UUID other = (UUID) obj;
         if (val == null) {
-            if (other.val != null)
+            if (other.val != null) {
                 return false;
-        } else if (!val.equals(other.val))
+            }
+        } else if (!val.equals(other.val)) {
             return false;
+        }
         return true;
     }
 }
index fc72f39743a7090030e8eac077a3df93b1d13638..53f05b4c4b76365a35a30925148c183a7296b2d3 100644 (file)
@@ -36,10 +36,10 @@ public class Version implements Comparable<Version> {
     public static final Version NULL = new Version(0,0,0);
     public static final String NULL_VERSION_STRING = "0.0.0";
 
-    public static Version fromString(String version){
+    public static Version fromString(String version) {
         final Matcher matcher = Version.PATTERN.matcher(version);
         if (!matcher.find()) {
-            throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT);
+            throw new IllegalArgumentException("<" + version + "> does not match format " + Version.FORMAT);
         }
         int major = Integer.valueOf(matcher.group(1));
         int minor = Integer.valueOf(matcher.group(2));
@@ -47,7 +47,7 @@ public class Version implements Comparable<Version> {
         return new Version(major, minor, patch);
     }
 
-    public String toString(){
+    public String toString() {
         return "" + major + "." + minor + "." + patch;
     }
 
@@ -79,15 +79,25 @@ public class Version implements Comparable<Version> {
     // ToDo: While format is X.X.X semantics are schema dependent.
     // Therefore we should allow equals to be overridden by the schema
     @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
+    public boolean equals(Object object) {
+        if (this == object) {
+            return true;
+        }
+        if (object == null || getClass() != object.getClass()) {
+            return false;
+        }
 
-        Version version = (Version) o;
+        Version version = (Version) object;
 
-        if (major != version.major) return false;
-        if (minor != version.minor) return false;
-        if (patch != version.patch) return false;
+        if (major != version.major) {
+            return false;
+        }
+        if (minor != version.minor) {
+            return false;
+        }
+        if (patch != version.patch) {
+            return false;
+        }
 
         return true;
     }
@@ -103,15 +113,27 @@ public class Version implements Comparable<Version> {
     // ToDo: While format is X.X.X semantics are schema dependent
     // Therefore we should allow compareTo to be overridden by the schema
     @Override
-    public int compareTo(Version o) {
-        if (this.equals(o)) return 0;
-        if (this.major > o.major) return 1;
-        if (this.major < o.major) return -1;
+    public int compareTo(Version version) {
+        if (this.equals(version)) {
+            return 0;
+        }
+        if (this.major > version.major) {
+            return 1;
+        }
+        if (this.major < version.major) {
+            return -1;
+        }
         // major is equal
-        if (this.minor > o.minor) return 1;
-        if (this.minor < o.minor) return -1;
+        if (this.minor > version.minor) {
+            return 1;
+        }
+        if (this.minor < version.minor) {
+            return -1;
+        }
         // minor is equal
-        if (this.patch > o.patch) return 1;
+        if (this.patch > version.patch) {
+            return 1;
+        }
         // must be less than
         return -1;
     }
index 463f9579914e4a0c90de504fa8ea804d461fb9a8..63a4646283c5599c8b60e105746b395ee9e4a126 100644 (file)
@@ -128,6 +128,8 @@ public class Converter {
                         }
                     case STRING:
                         return node.asText();
+                    default:
+                        break;
                 }
             }
 
index b584fa47ea2e495138738c0f769126f2844ce59e..d2b08e64c2247b6418a236d769f0dcd08f4cd29f 100644 (file)
@@ -27,10 +27,10 @@ public class OvsdbMapSerializer extends JsonSerializer<OvsdbMap<?,?>> {
         generator.writeString("map");
         generator.writeStartArray();
         Map<?,?> javaMap = map.delegate();
-        for (Object t : javaMap.keySet()) {
+        for (Object set : javaMap.keySet()) {
             generator.writeStartArray();
-            generator.writeObject(t);
-            generator.writeObject(javaMap.get(t));
+            generator.writeObject(set);
+            generator.writeObject(javaMap.get(set));
             generator.writeEndArray();
         }
         generator.writeEndArray();
index 5e8c6000666ceab93ff41e9703416049a19cb56f..c768d4881cff19aa2a708536a6a8c0193a8688d4 100644 (file)
@@ -28,8 +28,8 @@ public class OvsdbSetSerializer extends JsonSerializer<OvsdbSet<?>> {
         generator.writeString("set");
         generator.writeStartArray();
         Set<?> javaSet = set.delegate();
-        for (Object t : javaSet) {
-            generator.writeObject(t);
+        for (Object setObject : javaSet) {
+            generator.writeObject(setObject);
         }
         generator.writeEndArray();
         generator.writeEndArray();
index 2829128230efd3c66c6a406742656d96c638e6d8..3675d4a2eeec0eda829dce7e6b9f797fb70a352f 100644 (file)
@@ -19,40 +19,40 @@ import org.opendaylight.ovsdb.lib.notation.UUID;
 
 public  class OvsdbTypesIdResolver implements TypeIdResolver {
 
-        private JavaType baseType;
-
-        @Override
-        public void init(JavaType bt) {
-            this.baseType = bt;
-        }
-
-        @Override
-        public String idFromValue(Object value) {
-            throw new UnsupportedOperationException("not yet done");
-        }
-
-        @Override
-        public String idFromValueAndType(Object value, Class<?> suggestedType) {
-            throw new UnsupportedOperationException("not yet done");
-        }
-
-        @Override
-        public String idFromBaseType() {
-            throw new UnsupportedOperationException("not yet done");
-        }
-
-        @Override
-        public JavaType typeFromId(String id) {
-            if ("set".equals(id)) {
-                return TypeFactory.defaultInstance().constructCollectionType(OvsdbSet.class, Object.class);
-            } else if ("uuid".equals(id) || "named-uuid".equals(id)) {
-                return TypeFactory.defaultInstance().constructType(UUID.class);
-            }
-            return null;
-        }
-
-        @Override
-        public JsonTypeInfo.Id getMechanism() {
-            throw new UnsupportedOperationException("not yet done");
+    private JavaType baseType;
+
+    @Override
+    public void init(JavaType bt) {
+        this.baseType = bt;
+    }
+
+    @Override
+    public String idFromValue(Object value) {
+        throw new UnsupportedOperationException("not yet done");
+    }
+
+    @Override
+    public String idFromValueAndType(Object value, Class<?> suggestedType) {
+        throw new UnsupportedOperationException("not yet done");
+    }
+
+    @Override
+    public String idFromBaseType() {
+        throw new UnsupportedOperationException("not yet done");
+    }
+
+    @Override
+    public JavaType typeFromId(String id) {
+        if ("set".equals(id)) {
+            return TypeFactory.defaultInstance().constructCollectionType(OvsdbSet.class, Object.class);
+        } else if ("uuid".equals(id) || "named-uuid".equals(id)) {
+            return TypeFactory.defaultInstance().constructType(UUID.class);
         }
-    }
\ No newline at end of file
+        return null;
+    }
+
+    @Override
+    public JsonTypeInfo.Id getMechanism() {
+        throw new UnsupportedOperationException("not yet done");
+    }
+}
\ No newline at end of file
index c4e82904c7a1fdce9487b76cd726794bfdaf9333..326b20e36b6f07b7af31e448e392fd7bf95a73ca 100644 (file)
@@ -28,7 +28,7 @@ public class Delete<E extends TableSchema<E>> extends Operation<E> implements Co
         super(schema, DELETE);
     }
 
-    public Delete<E> on(TableSchema schema){
+    public Delete<E> on(TableSchema schema) {
         return this;
     }
 
index a77d60b16178f28f2f7f43eecea0654d5bf6449d..e07cf71c675d12e4ec21a168e87354c94aad5d49 100644 (file)
@@ -33,7 +33,7 @@ public class Insert<E extends TableSchema<E>> extends Operation<E> {
 
     private Map<String, Object> row = Maps.newHashMap();
 
-    public Insert<E> on(TableSchema<E> schema){
+    public Insert<E> on(TableSchema<E> schema) {
         this.setTableSchema(schema);
         return this;
     }
index 4bb494cc15ba528468cdd3f519cc901eaab682cd..b26cdf3e4835a386a014dde747a830c60119ff7d 100644 (file)
@@ -26,7 +26,7 @@ public class Mutate<E extends TableSchema<E>> extends Operation<E> implements Co
     List<Condition> where = Lists.newArrayList();
     private List<Mutation> mutations = Lists.newArrayList();
 
-    public Mutate on(TableSchema schema){
+    public Mutate on(TableSchema schema) {
         this.setTableSchema(schema);
         return this;
     }
@@ -35,7 +35,8 @@ public class Mutate<E extends TableSchema<E>> extends Operation<E> implements Co
         super(schema, MUTATE);
     }
 
-    public <T extends TableSchema<T>, D> Mutate<E> addMutation(ColumnSchema<T, D> columnSchema, Mutator mutator, D value) {
+    public <T extends TableSchema<T>, D> Mutate<E> addMutation(ColumnSchema<T, D> columnSchema,
+                                                               Mutator mutator, D value) {
         columnSchema.validate(value);
         Object untypedValue = columnSchema.getNormalizeData(value);
         mutations.add(new Mutation(columnSchema.getName(), mutator, untypedValue));
index d3d7805689fb33c6e8ad2592ab8dc6b4c50a8848..85329a91041d4fe48e1c02433708b17ed37e6029 100644 (file)
@@ -23,7 +23,7 @@ public class Select<E extends TableSchema<E>> extends Operation<E> implements Co
     List<Condition> where = Lists.newArrayList();
     private List<String> columns = Lists.newArrayList();
 
-    public Select on(TableSchema schema){
+    public Select on(TableSchema schema) {
         this.setTableSchema(schema);
         return this;
     }
index b8d4b1f4f17f137ca1a30b8502210185c1061e75..f36a652e439241883e503fb8b255238e7a31a720 100644 (file)
@@ -24,13 +24,13 @@ import com.google.common.util.concurrent.ListenableFuture;
 
 public class TransactionBuilder {
 
-    private DatabaseSchema eDatabaseSchema;
+    private DatabaseSchema databaseSchema;
     OvsdbClient ovs;
     ArrayList<Operation> operations = Lists.newArrayList();
 
     public TransactionBuilder(OvsdbClient ovs, DatabaseSchema schema) {
         this.ovs = ovs;
-        eDatabaseSchema = schema;
+        databaseSchema = schema;
     }
 
     public ArrayList<Operation> getOperations() {
@@ -47,10 +47,10 @@ public class TransactionBuilder {
     }
 
     public ListenableFuture<List<OperationResult>> execute() {
-        return ovs.transact(eDatabaseSchema, operations);
+        return ovs.transact(databaseSchema, operations);
     }
 
     public DatabaseSchema getDatabaseSchema() {
-        return eDatabaseSchema;
+        return databaseSchema;
     }
 }
index 88b26078a1fc678a831dafefcbe4582e2a7d9e06..ed52c956cf111c53f01b2e188356924144b3dcff 100644 (file)
@@ -41,7 +41,7 @@ public class Update<E extends TableSchema<E>> extends Operation<E> implements Co
         super(schema, UPDATE);
     }
 
-    public Update<E> on(TableSchema schema){
+    public Update<E> on(TableSchema schema) {
         return this;
     }
 
index 9730bc5f68609d84359fcd9b67e0df22fb79dc23..25b7d8a90ca5bff23a3584eb5e188fbe4c5885a8 100644 (file)
@@ -31,9 +31,9 @@ public class Activator extends DependencyActivatorBase {
             .setInterface(OvsdbConnection.class.getName(), null)
             .setImplementation(OvsdbConnectionService.class)
             .add(createServiceDependency()
-               .setService(OvsdbConnectionListener.class)
-               .setCallbacks("registerConnectionListener", "unregisterConnectionListener")
-               .setRequired(false)
+                            .setService(OvsdbConnectionListener.class)
+                            .setCallbacks("registerConnectionListener", "unregisterConnectionListener")
+                            .setRequired(false)
             )
         );
     }
index 070de83249ff8347e7a48f08e9b8353ffa6bb4c2..3738bf5b6c59e8fcff70319617bf42ab3abc077e 100644 (file)
@@ -20,12 +20,12 @@ import com.google.common.collect.Sets;
 
 public abstract class BaseType<E extends BaseType<E>> {
 
-    private static BaseType[] types = new BaseType[]{
-            new StringBaseType(),
-            new IntegerBaseType(),
-            new RealBaseType(),
-            new BooleanBaseType(),
-            new UuidBaseType(),
+    private static BaseType[] types = new BaseType[] {
+        new StringBaseType(),
+        new IntegerBaseType(),
+        new RealBaseType(),
+        new BooleanBaseType(),
+        new UuidBaseType(),
     };
 
     public static BaseType fromJson(JsonNode json, String keyorval) {
@@ -122,10 +122,10 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         private void populateEnum(JsonNode node) {
             if (node.has("enum")) {
-                Set<Long> s = Sets.newHashSet();
+                Set<Long> enums = Sets.newHashSet();
                 JsonNode anEnum = node.get("enum").get(1);
-                for (JsonNode n : anEnum) {
-                    s.add(n.asLong());
+                for (JsonNode enm : anEnum) {
+                    enums.add(enm.asLong());
                 }
             }
         }
@@ -172,22 +172,29 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
+            if (this == obj) {
                 return true;
-            if (obj == null)
+            }
+            if (obj == null) {
                 return false;
-            if (getClass() != obj.getClass())
+            }
+            if (getClass() != obj.getClass()) {
                 return false;
+            }
             IntegerBaseType other = (IntegerBaseType) obj;
             if (enums == null) {
-                if (other.enums != null)
+                if (other.enums != null) {
                     return false;
-            } else if (!enums.equals(other.enums))
+                }
+            } else if (!enums.equals(other.enums)) {
                 return false;
-            if (max != other.max)
+            }
+            if (max != other.max) {
                 return false;
-            if (min != other.min)
+            }
+            if (min != other.min) {
                 return false;
+            }
             return true;
         }
     }
@@ -230,10 +237,10 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         private void populateEnum(JsonNode node) {
             if (node.has("enum")) {
-                Set<Double> s = Sets.newHashSet();
+                Set<Double> enums = Sets.newHashSet();
                 JsonNode anEnum = node.get("enum").get(1);
-                for (JsonNode n : anEnum) {
-                    s.add(n.asDouble());
+                for (JsonNode enm : anEnum) {
+                    enums.add(enm.asDouble());
                 }
             }
         }
@@ -282,24 +289,29 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
+            if (this == obj) {
                 return true;
-            if (obj == null)
+            }
+            if (obj == null) {
                 return false;
-            if (getClass() != obj.getClass())
+            }
+            if (getClass() != obj.getClass()) {
                 return false;
+            }
             RealBaseType other = (RealBaseType) obj;
             if (enums == null) {
-                if (other.enums != null)
+                if (other.enums != null) {
                     return false;
-            } else if (!enums.equals(other.enums))
+                }
+            } else if (!enums.equals(other.enums)) {
                 return false;
-            if (Double.doubleToLongBits(max) != Double
-                    .doubleToLongBits(other.max))
+            }
+            if (Double.doubleToLongBits(max) != Double.doubleToLongBits(other.max)) {
                 return false;
-            if (Double.doubleToLongBits(min) != Double
-                    .doubleToLongBits(other.min))
+            }
+            if (Double.doubleToLongBits(min) != Double.doubleToLongBits(other.min)) {
                 return false;
+            }
             return true;
         }
     }
@@ -371,17 +383,17 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         private void populateEnum(StringBaseType baseType, JsonNode node) {
             if (node.has("enum")) {
-                Set<String> s = Sets.newHashSet();
+                Set<String> enums = Sets.newHashSet();
                 JsonNode enumVal = node.get("enum");
                 if (enumVal.isArray()) {
                     JsonNode anEnum = enumVal.get(1);
-                    for (JsonNode n : anEnum) {
-                        s.add(n.asText());
+                    for (JsonNode enm : anEnum) {
+                        enums.add(enm.asText());
                     }
                 } else if (enumVal.isTextual()) {
-                    s.add(enumVal.asText());
+                    enums.add(enumVal.asText());
                 }
-                baseType.setEnums(s);
+                baseType.setEnums(enums);
             }
         }
 
@@ -426,22 +438,29 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
+            if (this == obj) {
                 return true;
-            if (obj == null)
+            }
+            if (obj == null) {
                 return false;
-            if (getClass() != obj.getClass())
+            }
+            if (getClass() != obj.getClass()) {
                 return false;
+            }
             StringBaseType other = (StringBaseType) obj;
             if (enums == null) {
-                if (other.enums != null)
+                if (other.enums != null) {
                     return false;
-            } else if (!enums.equals(other.enums))
+                }
+            } else if (!enums.equals(other.enums)) {
                 return false;
-            if (maxLength != other.maxLength)
+            }
+            if (maxLength != other.maxLength) {
                 return false;
-            if (minLength != other.minLength)
+            }
+            if (minLength != other.minLength) {
                 return false;
+            }
             return true;
         }
 
@@ -449,7 +468,7 @@ public abstract class BaseType<E extends BaseType<E>> {
 
 
     public static class UuidBaseType extends BaseType<UuidBaseType> {
-        public static enum RefType {strong, weak}
+        public static enum RefType { strong, weak }
 
         String refTable;
         RefType refType;
@@ -473,7 +492,7 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         @Override
         public Object toValue(JsonNode value) {
-            if(value.isArray()) {
+            if (value.isArray()) {
                 if (value.size() == 2) {
                     if (value.get(0).isTextual() && "uuid".equals(value.get(0).asText())) {
                         return new UUID(value.get(1).asText());
@@ -530,20 +549,26 @@ public abstract class BaseType<E extends BaseType<E>> {
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
+            if (this == obj) {
                 return true;
-            if (obj == null)
+            }
+            if (obj == null) {
                 return false;
-            if (getClass() != obj.getClass())
+            }
+            if (getClass() != obj.getClass()) {
                 return false;
+            }
             UuidBaseType other = (UuidBaseType) obj;
             if (refTable == null) {
-                if (other.refTable != null)
+                if (other.refTable != null) {
                     return false;
-            } else if (!refTable.equals(other.refTable))
+                }
+            } else if (!refTable.equals(other.refTable)) {
                 return false;
-            if (refType != other.refType)
+            }
+            if (refType != other.refType) {
                 return false;
+            }
             return true;
         }
     }
index 78fc50dc43213917134705b3d8ad418944443c66..cf5664d19a2575d7ba5dcba82f6ad80b13781b46 100644 (file)
@@ -44,7 +44,9 @@ public class ColumnSchema<E extends TableSchema<E>, D> {
         return name;
     }
 
-    public ColumnType getType() { return type; }
+    public ColumnType getType() {
+        return type;
+    }
 
     // --- Operations on the column ----------//
 
@@ -77,10 +79,10 @@ public class ColumnSchema<E extends TableSchema<E>, D> {
 
     @Override
     public String toString() {
-        return "ColumnSchema{" +
-                "name='" + name + '\'' +
-                ", type=" + type +
-                '}';
+        return "ColumnSchema{"
+                + "name='" + name + '\''
+                + ", type=" + type
+                '}';
     }
 
     @Override
@@ -94,23 +96,30 @@ public class ColumnSchema<E extends TableSchema<E>, D> {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         ColumnSchema other = (ColumnSchema) obj;
         if (name == null) {
-            if (other.name != null)
+            if (other.name != null) {
                 return false;
-        } else if (!name.equals(other.name))
+            }
+        } else if (!name.equals(other.name)) {
             return false;
+        }
         if (type == null) {
-            if (other.type != null)
+            if (other.type != null) {
                 return false;
-        } else if (!type.equals(other.type))
+            }
+        } else if (!type.equals(other.type)) {
             return false;
+        }
         return true;
     }
 
@@ -134,7 +143,7 @@ public class ColumnSchema<E extends TableSchema<E>, D> {
     }
 
     public D valueFromJson(JsonNode value) {
-      return (D) this.getType().valueFromJson(value);
+        return (D) this.getType().valueFromJson(value);
     }
 
     public Object getNormalizeData(D value) {
index bb919a1cf16d327995489606adf56c0f79ab4a50..e2d09cac4e6f5322be5dc645f1c6de2488af89b1 100644 (file)
@@ -39,9 +39,9 @@ public abstract class ColumnType {
         this.max = max;
     }
 
-    private static ColumnType columns[] = new ColumnType[]{
-            new AtomicColumnType(),
-            new KeyValuedColumnType()
+    private static ColumnType[] columns = new ColumnType[] {
+        new AtomicColumnType(),
+        new KeyValuedColumnType()
     };
 
 
@@ -98,8 +98,9 @@ public abstract class ColumnType {
 
     /*
      * Per RFC 7047, Section 3.2 <type> :
-     * If "min" or "max" is not specified, each defaults to 1.  If "max" is specified as "unlimited", then there is no specified maximum
-     * number of elements, although the implementation will enforce some limit.  After considering defaults, "min" must be exactly 0 or
+     * If "min" or "max" is not specified, each defaults to 1.  If "max" is specified as "unlimited",
+     * then there is no specified maximum number of elements, although the implementation will
+     * enforce some limit.  After considering defaults, "min" must be exactly 0 or
      * exactly 1, "max" must be at least 1, and "max" must be greater than or equal to "min".
      *
      * If "min" and "max" are both 1 and "value" is not specified, the
@@ -115,11 +116,11 @@ public abstract class ColumnType {
 
     @Override
     public String toString() {
-        return "ColumnType{" +
-                "baseType=" + baseType +
-                ", min=" + min +
-                ", max=" + max +
-                '}';
+        return "ColumnType{"
+                + "baseType=" + baseType
+                + ", min=" + min
+                + ", max=" + max
+                '}';
     }
 
     @Override
@@ -135,22 +136,29 @@ public abstract class ColumnType {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         ColumnType other = (ColumnType) obj;
         if (baseType == null) {
-            if (other.baseType != null)
+            if (other.baseType != null) {
                 return false;
-        } else if (!baseType.equals(other.baseType))
+            }
+        } else if (!baseType.equals(other.baseType)) {
             return false;
-        if (max != other.max)
+        }
+        if (max != other.max) {
             return false;
-        if (min != other.min)
+        }
+        if (min != other.min) {
             return false;
+        }
         return true;
     }
 
@@ -180,7 +188,7 @@ public abstract class ColumnType {
                 }
 
                 if ((node = json.get("max")) != null) {
-                    if (node.isNumber()){
+                    if (node.isNumber()) {
                         atomicColumnType.setMax(node.asLong());
                     } else if ("unlimited".equals(node.asText())) {
                         atomicColumnType.setMax(Long.MAX_VALUE);
@@ -196,10 +204,10 @@ public abstract class ColumnType {
         public Object valueFromJson(JsonNode value) {
             if (isMultiValued()) {
                 OvsdbSet<Object> result = new OvsdbSet<Object>();
-                if(value.isArray()) {
+                if (value.isArray()) {
                     if (value.size() == 2) {
                         if (value.get(0).isTextual() && "set".equals(value.get(0).asText())) {
-                            for(JsonNode node: value.get(1)) {
+                            for (JsonNode node: value.get(1)) {
                                 result.add(getBaseType().toValue(node));
                             }
                         } else {
@@ -252,7 +260,7 @@ public abstract class ColumnType {
             }
 
             if ((node = json.get("max")) != null) {
-                if (node.isLong()){
+                if (node.isLong()) {
                     keyValueColumnType.setMax(node.asLong());
                 } else if (node.isTextual() && "unlimited".equals(node.asText())) {
                     keyValueColumnType.setMax(Long.MAX_VALUE);
@@ -291,7 +299,7 @@ public abstract class ColumnType {
 
         @Override
         public String toString() {
-            return "KeyValuedColumnType [keyType=" + keyType + " "+ super.toString() +"]";
+            return "KeyValuedColumnType [keyType=" + keyType + " " + super.toString() + "]";
         }
 
         @Override
@@ -305,18 +313,23 @@ public abstract class ColumnType {
 
         @Override
         public boolean equals(Object obj) {
-            if (this == obj)
+            if (this == obj) {
                 return true;
-            if (!super.equals(obj))
+            }
+            if (!super.equals(obj)) {
                 return false;
-            if (getClass() != obj.getClass())
+            }
+            if (getClass() != obj.getClass()) {
                 return false;
+            }
             KeyValuedColumnType other = (KeyValuedColumnType) obj;
             if (keyType == null) {
-                if (other.keyType != null)
+                if (other.keyType != null) {
                     return false;
-            } else if (!keyType.equals(other.keyType))
+                }
+            } else if (!keyType.equals(other.keyType)) {
                 return false;
+            }
             return true;
         }
     }
index b626567bd201fc444fefedcf8c17e59c3eb41b42..e9a3b6d83c9b285a4622f599510a9ea4924ee20d 100644 (file)
@@ -76,8 +76,8 @@ public class DatabaseSchema {
         try {
             return invokable.invoke(null, table);
         } catch (Exception e) {
-            String message = String.format("Not able to create instance of class %s using public constructor " +
-                    "that accepts TableSchema object", clazz);
+            String message = String.format("Not able to create instance of class %s using public constructor "
+                    "that accepts TableSchema object", clazz);
             throw new IllegalArgumentException(message, e);
         }
     }
@@ -113,9 +113,13 @@ public class DatabaseSchema {
         this.name = name;
     }
 
-    public Version getVersion() { return version; }
+    public Version getVersion() {
+        return version;
+    }
 
-    public void setVersion(Version version) { this.version = version; }
+    public void setVersion(Version version) {
+        this.version = version;
+    }
 
     public void populateInternallyGeneratedColumns() {
         for (TableSchema tableSchema : tables.values()) {
index e8934ea4523032764d28923d53033434641eb395..c749132e19f0571c67aa7de0bb5360ac8bdac307 100644 (file)
@@ -29,7 +29,7 @@ public class GenericTableSchema extends TableSchema<GenericTableSchema> {
         super(tableName);
     }
 
-    public GenericTableSchema (TableSchema tableSchema) {
+    public GenericTableSchema(TableSchema tableSchema) {
         super(tableSchema.getName(), tableSchema.getColumnSchemas());
     }
 
index 3e430deecde96409c857d679f1dd466035854b25..a21ef2d4af787bbc9bf447019927e76b70b54e60 100644 (file)
@@ -70,8 +70,8 @@ public abstract class TableSchema<E extends TableSchema<E>> {
 
     public <E extends TableSchema<E>> E as(Class<E> clazz) {
         try {
-            Constructor<E> e = clazz.getConstructor(TableSchema.class);
-            return e.newInstance(this);
+            Constructor<E> instance = clazz.getConstructor(TableSchema.class);
+            return instance.newInstance(this);
         } catch (Exception e) {
             throw new RuntimeException("exception constructing instance of clazz " + clazz, e);
         }
@@ -131,11 +131,11 @@ public abstract class TableSchema<E extends TableSchema<E>> {
             Map.Entry<String, JsonNode> idOldNew = fields.next();
             String uuid = idOldNew.getKey();
 
-            ObjectNode new_ = (ObjectNode) idOldNew.getValue().get("new");
-            ObjectNode old = (ObjectNode) idOldNew.getValue().get("old");
+            ObjectNode newObjectNode = (ObjectNode) idOldNew.getValue().get("new");
+            ObjectNode oldObjectNode = (ObjectNode) idOldNew.getValue().get("old");
 
-            Row<E> newRow = new_ != null ? createRow(new_) : null;
-            Row<E> oldRow = old != null ? createRow(old) : null;
+            Row<E> newRow = newObjectNode != null ? createRow(newObjectNode) : null;
+            Row<E> oldRow = oldObjectNode != null ? createRow(oldObjectNode) : null;
 
             tableUpdate.addRow(new UUID(uuid), oldRow, newRow);
         }
@@ -154,8 +154,8 @@ public abstract class TableSchema<E extends TableSchema<E>> {
              * Hence adding some safety checks around that.
              */
             if (schema != null) {
-                Object o = schema.valueFromJson(next.getValue());
-                columns.add(new Column<>(schema, o));
+                Object value = schema.valueFromJson(next.getValue());
+                columns.add(new Column<>(schema, value));
             }
         }
         return new Row<>(this, columns);
index 66500a472d20af46de51c855ebcf65c3390df344..011a4c50e69c1dc6ee182abbee0984a93e5c067b 100644 (file)
@@ -14,22 +14,22 @@ import org.opendaylight.ovsdb.lib.notation.Row;
 import org.opendaylight.ovsdb.lib.notation.UUID;
 import org.opendaylight.ovsdb.lib.schema.TableSchema;
 
-public interface TypedBaseTable <E extends TableSchema<E>> {
-    @TypedColumn(name="", method=MethodType.GETTABLESCHEMA)
+public interface TypedBaseTable<E extends TableSchema<E>> {
+    @TypedColumn(name = "", method = MethodType.GETTABLESCHEMA)
     E getSchema();
 
-    @TypedColumn(name="", method=MethodType.GETROW)
+    @TypedColumn(name = "", method = MethodType.GETROW)
     Row<E> getRow();
 
-    @TypedColumn(name="_uuid", method=MethodType.GETDATA)
+    @TypedColumn(name = "_uuid", method = MethodType.GETDATA)
     public UUID getUuid();
 
-    @TypedColumn(name="_uuid", method=MethodType.GETCOLUMN)
+    @TypedColumn(name = "_uuid", method = MethodType.GETCOLUMN)
     public Column<E, UUID> getUuidColumn();
 
-    @TypedColumn(name="_version", method=MethodType.GETDATA)
+    @TypedColumn(name = "_version", method = MethodType.GETDATA)
     public UUID getVersion();
 
-    @TypedColumn(name="_version", method=MethodType.GETCOLUMN)
+    @TypedColumn(name = "_version", method = MethodType.GETCOLUMN)
     public Column<E, UUID> getVersionColumn();
 }
index 2eb3bd69bbc6ae73153700d244e4de6945855c02..6c9a21f9381f04ec5554f652c5277e487cd53907 100644 (file)
@@ -35,12 +35,12 @@ import com.google.common.base.Preconditions;
 import com.google.common.reflect.Reflection;
 
 public class TyperUtils {
-    private static final String GET_STARTS_WITH="get";
-    private static final String SET_STARTS_WITH="set";
-    private static final String GETCOLUMN_ENDS_WITH="Column";
-    private static final String GETROW_ENDS_WITH="Row";
+    private static final String GET_STARTS_WITH = "get";
+    private static final String SET_STARTS_WITH = "set";
+    private static final String GETCOLUMN_ENDS_WITH = "Column";
+    private static final String GETROW_ENDS_WITH = "Row";
 
-    private static <T> String getTableName (Class<T> klazz) {
+    private static <T> String getTableName(Class<T> klazz) {
         TypedTable typedTable = klazz.getAnnotation(TypedTable.class);
         if (typedTable != null) {
             return typedTable.name();
@@ -53,11 +53,12 @@ public class TyperUtils {
         return dbSchema.table(tableName, GenericTableSchema.class);
     }
 
-    public static ColumnSchema<GenericTableSchema, Object> getColumnSchema(GenericTableSchema tableSchema, String columnName, Class<Object> metaClass) {
+    public static ColumnSchema<GenericTableSchema, Object>
+    getColumnSchema(GenericTableSchema tableSchema, String columnName, Class<Object> metaClass) {
         return tableSchema.column(columnName, metaClass);
     }
 
-    private static String getColumnName (Method method) {
+    private static String getColumnName(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
             return typedColumn.name();
@@ -74,13 +75,14 @@ public class TyperUtils {
         if (isGetData(method) || isSetData(method)) {
             return method.getName().substring(index, method.getName().length()).toLowerCase();
         } else if (isGetColumn(method)) {
-            return method.getName().substring(index, method.getName().indexOf(GETCOLUMN_ENDS_WITH, index)).toLowerCase();
+            return method.getName().substring(index, method.getName().indexOf(GETCOLUMN_ENDS_WITH,
+                    index)).toLowerCase();
         }
 
         return null;
     }
 
-    private static boolean isGetTableSchema (Method method) {
+    private static boolean isGetTableSchema(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
             return typedColumn.method().equals(MethodType.GETTABLESCHEMA) ? true : false;
@@ -88,7 +90,7 @@ public class TyperUtils {
         return false;
     }
 
-    private static boolean isGetRow (Method method) {
+    private static boolean isGetRow(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
             return typedColumn.method().equals(MethodType.GETROW) ? true : false;
@@ -100,7 +102,7 @@ public class TyperUtils {
         return false;
     }
 
-    private static boolean isGetColumn (Method method) {
+    private static boolean isGetColumn(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
             return typedColumn.method().equals(MethodType.GETCOLUMN) ? true : false;
@@ -112,7 +114,7 @@ public class TyperUtils {
         return false;
     }
 
-    private static boolean isGetData (Method method) {
+    private static boolean isGetData(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
             return typedColumn.method().equals(MethodType.GETDATA) ? true : false;
@@ -124,7 +126,7 @@ public class TyperUtils {
         return false;
     }
 
-    private static boolean isSetData (Method method) {
+    private static boolean isSetData(Method method) {
         TypedColumn typedColumn = method.getAnnotation(TypedColumn.class);
         if (typedColumn != null) {
             return typedColumn.method().equals(MethodType.SETDATA) ? true : false;
@@ -177,7 +179,7 @@ public class TyperUtils {
      * @param klazz Typed Class that represents a Table
      * @return true if valid, false otherwise
      */
-    private static <T> boolean isValid (DatabaseSchema dbSchema, final Class<T> klazz) {
+    private static <T> boolean isValid(DatabaseSchema dbSchema, final Class<T> klazz) {
         if (dbSchema == null) {
             return false;
         }
@@ -208,7 +210,7 @@ public class TyperUtils {
         checkVersion(schemaVersion, fromVersion, untilVersion);
     }
 
-    private static void checkVersion(Version schemaVersion, Version fromVersion, Version untilVersion){
+    private static void checkVersion(Version schemaVersion, Version fromVersion, Version untilVersion) {
         if (!fromVersion.equals(Version.NULL)) {
             if (schemaVersion.compareTo(fromVersion) < 0) {
                 String message = SchemaVersionMismatchException.createMessage(schemaVersion, fromVersion);
@@ -225,13 +227,16 @@ public class TyperUtils {
 
     /**
      * This method returns a Typed Proxy implementation for the klazz passed as a parameter.
-     * Per design choice, the Typed Proxy implementation is just a Wrapper on top of the actual Row which is untyped.
-     * Being just a wrapper, it is state-less and more of a convenience functionality to provide a type-safe infrastructure
-     * for the applications to built on top of. And this Typed infra is completely optional.
+     * Per design choice, the Typed Proxy implementation is just a Wrapper on top of the actual
+     * Row which is untyped.
+     * Being just a wrapper, it is state-less and more of a convenience functionality to
+     * provide a type-safe infrastructure for the applications to built on top of.
+     * And this Typed infra is completely optional.
      *
-     * It is the applications responsibilty to pass on the raw Row parameter & this method will return the appropriate
-     * Proxy wrapper for the passed klazz Type. The raw Row parameter may be null if the caller is interested in just the
-     * ColumnSchema. But that is not a very common use-case.
+     * It is the applications responsibility to pass on the raw Row parameter & this method will
+     * return the appropriate Proxy wrapper for the passed klazz Type.
+     * The raw Row parameter may be null if the caller is interested in just the ColumnSchema.
+     * But that is not a very common use-case.
      *
      * @param dbSchema DatabaseSchema as learnt from a OVSDB connection
      * @param klazz Typed Class that represents a Table
@@ -243,37 +248,46 @@ public class TyperUtils {
 
     /**
      * This method returns a Typed Proxy implementation for the klazz passed as a parameter.
-     * Per design choice, the Typed Proxy implementation is just a Wrapper on top of the actual Row which is untyped.
-     * Being just a wrapper, it is state-less and more of a convenience functionality to provide a type-safe infrastructure
-     * for the applications to built on top of. And this Typed infra is completely optional.
+     * Per design choice, the Typed Proxy implementation is just a Wrapper on top of the actual
+     * Row which is untyped.
+     * Being just a wrapper, it is state-less and more of a convenience functionality
+     * to provide a type-safe infrastructure for the applications to built on top of.
+     * And this Typed infra is completely optional.
      *
-     * It is the applications responsibilty to pass on the raw Row parameter & this method will return the appropriate
-     * Proxy wrapper for the passed klazz Type. The raw Row parameter may be null if the caller is interested in just the
+     * It is the applications responsibility to pass on the raw Row parameter & this method
+     * will return the appropriate Proxy wrapper for the passed klazz Type.
+     * The raw Row parameter may be null if the caller is interested in just the
      * ColumnSchema. But that is not a very common use-case.
      *
      * @param dbSchema DatabaseSchema as learnt from a OVSDB connection
      * @param klazz Typed Class that represents a Table
-     * @param row The actual Row that the wrapper is operating on. It can be null if the caller is just interested in getting ColumnSchema.
+     * @param row The actual Row that the wrapper is operating on. It can be null if the caller
+     *            is just interested in getting ColumnSchema.
      * @return
      */
-    public static <T> T getTypedRowWrapper(final DatabaseSchema dbSchema, final Class<T> klazz, final Row<GenericTableSchema> row) {
+    public static <T> T getTypedRowWrapper(final DatabaseSchema dbSchema, final Class<T> klazz,
+                                           final Row<GenericTableSchema> row) {
         if (!isValid(dbSchema, klazz)) {
             return null;
         }
-        if (row != null) row.setTableSchema(getTableSchema(dbSchema, klazz));
+        if (row != null) {
+            row.setTableSchema(getTableSchema(dbSchema, klazz));
+        }
         return Reflection.newProxy(klazz, new InvocationHandler() {
             private Object processGetData(Method method) throws Throwable {
                 String columnName = getColumnName(method);
                 checkColumnSchemaVersion(dbSchema, method);
                 if (columnName == null) {
-                    throw new TyperException("Error processing Getter : "+ method.getName());
+                    throw new TyperException("Error processing Getter : " + method.getName());
                 }
                 GenericTableSchema tableSchema = getTableSchema(dbSchema, klazz);
                 if (tableSchema == null) {
-                    String message = TableSchemaNotFoundException.createMessage(getTableName(klazz), dbSchema.getName());
+                    String message =
+                            TableSchemaNotFoundException.createMessage(getTableName(klazz), dbSchema.getName());
                     throw new TableSchemaNotFoundException(message);
                 }
-                ColumnSchema<GenericTableSchema, Object> columnSchema = getColumnSchema(tableSchema, columnName, (Class<Object>) method.getReturnType());
+                ColumnSchema<GenericTableSchema, Object> columnSchema =
+                        getColumnSchema(tableSchema, columnName, (Class<Object>) method.getReturnType());
                 if (columnSchema == null) {
                     String message = ColumnSchemaNotFoundException.createMessage(columnName, tableSchema.getName());
                     throw new ColumnSchemaNotFoundException(message);
@@ -292,19 +306,22 @@ public class TyperUtils {
                 String columnName = getColumnName(method);
                 checkColumnSchemaVersion(dbSchema, method);
                 if (columnName == null) {
-                    throw new TyperException("Error processing GetColumn : "+ method.getName());
+                    throw new TyperException("Error processing GetColumn : " + method.getName());
                 }
                 GenericTableSchema tableSchema = getTableSchema(dbSchema, klazz);
                 if (tableSchema == null) {
-                    String message = TableSchemaNotFoundException.createMessage(getTableName(klazz), dbSchema.getName());
+                    String message =
+                            TableSchemaNotFoundException.createMessage(getTableName(klazz), dbSchema.getName());
                     throw new TableSchemaNotFoundException(message);
                 }
-                ColumnSchema<GenericTableSchema, Object> columnSchema = getColumnSchema(tableSchema, columnName, (Class<Object>) method.getReturnType());
+                ColumnSchema<GenericTableSchema, Object> columnSchema =
+                        getColumnSchema(tableSchema, columnName, (Class<Object>) method.getReturnType());
                 if (columnSchema == null) {
                     String message = ColumnSchemaNotFoundException.createMessage(columnName, tableSchema.getName());
                     throw new ColumnSchemaNotFoundException(message);
                 }
-                // When the row is null, that might indicate that the user maybe interested only in the ColumnSchema and not on the Data.
+                // When the row is null, that might indicate that the user maybe interested
+                // only in the ColumnSchema and not on the Data.
                 if (row == null) {
                     return new Column<GenericTableSchema, Object>(columnSchema, null);
                 }
@@ -313,23 +330,26 @@ public class TyperUtils {
 
             private Object processSetData(Object proxy, Method method, Object[] args) throws Throwable {
                 if (args == null || args.length != 1) {
-                    throw new TyperException("Setter method : "+method.getName() + " requires 1 argument");
+                    throw new TyperException("Setter method : " + method.getName() + " requires 1 argument");
                 }
                 checkColumnSchemaVersion(dbSchema, method);
                 String columnName = getColumnName(method);
                 if (columnName == null) {
-                    throw new TyperException("Unable to locate Column Name for "+method.getName());
+                    throw new TyperException("Unable to locate Column Name for " + method.getName());
                 }
                 GenericTableSchema tableSchema = getTableSchema(dbSchema, klazz);
-                ColumnSchema<GenericTableSchema, Object> columnSchema = getColumnSchema(tableSchema, columnName,
-                                                                                        (Class<Object>) args[0].getClass());
-                Column<GenericTableSchema, Object> column = new Column<GenericTableSchema, Object>(columnSchema, args[0]);
+                ColumnSchema<GenericTableSchema, Object> columnSchema =
+                        getColumnSchema(tableSchema, columnName, (Class<Object>) args[0].getClass());
+                Column<GenericTableSchema, Object> column =
+                        new Column<GenericTableSchema, Object>(columnSchema, args[0]);
                 row.addColumn(columnName, column);
                 return proxy;
             }
 
             private Object processGetTableSchema() {
-                if (dbSchema == null) return null;
+                if (dbSchema == null) {
+                    return null;
+                }
                 return getTableSchema(dbSchema, klazz);
             }
 
@@ -353,9 +373,9 @@ public class TyperUtils {
                     return processGetRow();
                 } else if (isSetData(method)) {
                     return processSetData(proxy, method, args);
-                } else if(isGetData(method)) {
+                } else if (isGetData(method)) {
                     return processGetData(method);
-                } else if(isGetColumn(method)) {
+                } else if (isGetColumn(method)) {
                     return processGetColumn(method);
                 } else if (isHashCodeMethod(method, args)) {
                     return hashCode();
@@ -364,20 +384,28 @@ public class TyperUtils {
                 } else if (isToStringMethod(method, args)) {
                     return this.toString();
                 }
-                throw new UnsupportedMethodException("Method not supported "+method.toString());
+                throw new UnsupportedMethodException("Method not supported " + method.toString());
             }
 
             @Override
             public boolean equals(Object obj) {
-                if (obj == null) return false;
+                if (obj == null) {
+                    return false;
+                }
                 TypedBaseTable<?> typedRowObj = (TypedBaseTable<?>)obj;
-                if (row == null && typedRowObj.getRow() == null) return true;
-                if (row.equals(typedRowObj.getRow())) return true;
+                if (row == null && typedRowObj.getRow() == null) {
+                    return true;
+                }
+                if (row.equals(typedRowObj.getRow())) {
+                    return true;
+                }
                 return false;
             }
 
             @Override public int hashCode() {
-                if (row == null) return 0;
+                if (row == null) {
+                    return 0;
+                }
                 return row.hashCode();
             }
 
@@ -389,8 +417,10 @@ public class TyperUtils {
                 } catch (Exception e) {
                     tableName = "";
                 }
-                if (row == null) return tableName;
-                return tableName+" : "+row.toString();
+                if (row == null) {
+                    return tableName;
+                }
+                return tableName + " : " + row.toString();
             }
         }
         );
@@ -414,11 +444,12 @@ public class TyperUtils {
         Preconditions.checkNotNull(updates);
         Preconditions.checkNotNull(dbSchema);
         Map<UUID,T> result = new HashMap<UUID,T>();
-
-        Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rowUpdates = extractRowUpdates(klazz,updates,dbSchema);
+        @SuppressWarnings("checkstyle:genericwhitespace")
+        Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rowUpdates =
+                extractRowUpdates(klazz,updates,dbSchema);
         for (TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema> rowUpdate : rowUpdates.values()) {
-            if(rowUpdate != null) {
-                if(rowUpdate.getNew() != null) {
+            if (rowUpdate != null) {
+                if (rowUpdate.getNew() != null) {
                     Row<GenericTableSchema> row = rowUpdate.getNew();
                     result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
                 }
@@ -445,11 +476,12 @@ public class TyperUtils {
         Preconditions.checkNotNull(updates);
         Preconditions.checkNotNull(dbSchema);
         Map<UUID,T> result = new HashMap<UUID,T>();
-
-        Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rowUpdates = extractRowUpdates(klazz,updates,dbSchema);
+        @SuppressWarnings("checkstyle:genericwhitespace")
+        Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rowUpdates =
+                extractRowUpdates(klazz,updates,dbSchema);
         for (TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema> rowUpdate : rowUpdates.values()) {
-            if(rowUpdate != null) {
-                if(rowUpdate.getNew() == null && rowUpdate.getOld() != null) {
+            if (rowUpdate != null) {
+                if (rowUpdate.getNew() == null && rowUpdate.getOld() != null) {
                     Row<GenericTableSchema> row = rowUpdate.getOld();
                     result.put(rowUpdate.getUuid(),TyperUtils.getTypedRowWrapper(dbSchema,klazz,row));
                 }
@@ -463,23 +495,28 @@ public class TyperUtils {
      * that correspond to rows of type klazz.
      * Example:
      * <code>
-     * Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> updatedBridges = extractRowsUpdates(Bridge.class,updates,dbSchema)
+     * Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> updatedBridges =
+     *     extractRowsUpdates(Bridge.class,updates,dbSchema)
      * </code>
      *
      * @param klazz Class for row type to be extracted
      * @param updates TableUpdates from which to extract rowUpdates
      * @param dbSchema Dbschema for the TableUpdates
-     * @return Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> for the type of things being sought
+     * @return Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>>
+     *     for the type of things being sought
      */
-    public static Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> extractRowUpdates(Class<?> klazz,TableUpdates updates,DatabaseSchema dbSchema) {
+    @SuppressWarnings("checkstyle:genericwhitespace")
+    public static Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>>
+    extractRowUpdates(Class<?> klazz,TableUpdates updates,DatabaseSchema dbSchema) {
         Preconditions.checkNotNull(klazz);
         Preconditions.checkNotNull(updates);
         Preconditions.checkNotNull(dbSchema);
-        Map<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> result = new HashMap<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>>();
+        Map<UUID, TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> result =
+                new HashMap<UUID,TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>>();
         TableUpdate<GenericTableSchema> update = updates.getUpdate(TyperUtils.getTableSchema(dbSchema, klazz));
-        if(update != null) {
+        if (update != null) {
             Map<UUID, TableUpdate<GenericTableSchema>.RowUpdate<GenericTableSchema>> rows = update.getRows();
-            if(rows != null) {
+            if (rows != null) {
                 result = rows;
             }
         }