Fix CS warnings in cds-access-api and enable enforcement 59/47459/4
authorTom Pantelis <tpanteli@brocade.com>
Mon, 24 Oct 2016 20:43:22 +0000 (16:43 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 26 Oct 2016 16:30:23 +0000 (16:30 +0000)
Fixed checkstyle warnings and enabled enforcement. Most of the
warnings/changes were for:
 - variable name too short
 - correct ordering of @Nonnull annotations
 - line too long
 - suppressing CS RedundantModifier warning for ctors where public is needed
   for packaged-scoped classes that implement Externalizable
 - adding protected to ctors for packaged-scoped abstract classes that
   implement Externalizable to avoid CS RedundantModifier warning
 - local vars/params hiding a field
 - putting overloaded methods close to one another

Change-Id: Ib85e15f21118f3484ccb8e945e8257ae3e3278bc
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
70 files changed:
opendaylight/md-sal/cds-access-api/pom.xml
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/ABIVersion.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/AbstractVersionException.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbortLocalTransactionRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbstractLocalHistoryRequestProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbstractLocalTransactionRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbstractReadTransactionRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbstractReadTransactionRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbstractTransactionRequestProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbstractTransactionSuccessProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/CommitLocalTransactionRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientFailureProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccess.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/CreateLocalHistoryRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/CreateLocalHistoryRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/DestroyLocalHistoryRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/DestroyLocalHistoryRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/LocalHistoryFailureProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/LocalHistorySuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ModifyTransactionRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/PersistenceProtocol.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/PurgeLocalHistoryRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ReadTransactionRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ReadTransactionRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ReadTransactionSuccess.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ReadTransactionSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionAbortRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionAbortSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionCanCommitSuccess.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionCanCommitSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionCommitSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionDoCommitRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionFailureProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionPreCommitRequest.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionPreCommitRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionPreCommitSuccess.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionPreCommitSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionSuccess.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/AbstractEnvelopeProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/AbstractMessageProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/AbstractRequestFailureProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/AbstractRequestProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/AbstractResponseEnvelopeProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/AbstractResponseProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/AbstractSuccessProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/ClientIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/Envelope.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/FailureEnvelopeProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/FrontendIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/FrontendType.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/MemberName.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/Message.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/Request.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestEnvelopeProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestException.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestFailure.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestSuccess.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/Response.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/SuccessEnvelopeProxy.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/TransactionIdentifier.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/ABIVersionTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/AbstractIdentifierTest.java
opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/concepts/MemberNameTest.java

index f1254e54516477649ebfd0b094f24bc86e4c7944..c8ab1a3f980c04e1d9bb7aef93baba594d786565 100644 (file)
         </dependency>
     </dependencies>
 
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <configuration>
+            <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+          </configuration>
+        </plugin>
+      </plugins>
+    </build>
+
     <scm>
         <connection>scm:git:http://git.opendaylight.org/gerrit/controller.git</connection>
         <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
index 0e40e6e1cb2dd3e3ac06140ddea0f4677aba0c2c..b476536b744b41d0cba493da91733092d504811a 100644 (file)
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
  */
 @Beta
 public enum ABIVersion implements WritableObject {
-    // NOTE: enumeration values need to be sorted in asceding order of their version to keep Comparable working
+    // NOTE: enumeration values need to be sorted in ascending order of their version to keep Comparable working
 
     /**
      * Version which is older than any other version. This version exists purely for testing purposes.
@@ -69,7 +69,8 @@ public enum ABIVersion implements WritableObject {
      *
      * @return Current {@link ABIVersion}
      */
-    public static @Nonnull ABIVersion current() {
+    @Nonnull
+    public static ABIVersion current() {
         return BORON;
     }
 
@@ -77,23 +78,24 @@ public enum ABIVersion implements WritableObject {
      * Return the {@link ABIVersion} corresponding to an unsigned short integer. This method is provided for callers
      * which provide their own recovery strategy in case of version incompatibility.
      *
-     * @param s Short integer as returned from {@link #shortValue()}
+     * @param value Short integer as returned from {@link #shortValue()}
      * @return {@link ABIVersion}
      * @throws FutureVersionException if the specified integer identifies a future version
      * @throws PastVersionException if the specified integer identifies a past version which is no longer supported
      */
-    public static @Nonnull ABIVersion valueOf(final short s) throws FutureVersionException, PastVersionException {
-        switch (Short.toUnsignedInt(s)) {
+    @Nonnull
+    public static ABIVersion valueOf(final short value) throws FutureVersionException, PastVersionException {
+        switch (Short.toUnsignedInt(value)) {
             case 0:
             case 1:
             case 2:
             case 3:
             case 4:
-                throw new PastVersionException(s, BORON);
+                throw new PastVersionException(value, BORON);
             case 5:
                 return BORON;
             default:
-                throw new FutureVersionException(s, BORON);
+                throw new FutureVersionException(value, BORON);
         }
     }
 
@@ -110,7 +112,8 @@ public enum ABIVersion implements WritableObject {
      * @return An {@link ABIVersion}
      * @throws IOException If read fails or an unsupported version is encountered
      */
-    public static @Nonnull ABIVersion readFrom(final @Nonnull DataInput in) throws IOException {
+    @Nonnull
+    public static ABIVersion readFrom(@Nonnull final DataInput in) throws IOException {
         final short s = in.readShort();
         try {
             return valueOf(s);
@@ -119,7 +122,7 @@ public enum ABIVersion implements WritableObject {
         }
     }
 
-    public static ABIVersion inexactReadFrom(final @Nonnull DataInput in) throws IOException {
+    public static ABIVersion inexactReadFrom(@Nonnull final DataInput in) throws IOException {
         final short onWire = in.readShort();
         try {
             return ABIVersion.valueOf(onWire);
index 11a27950f765951b5e3032db3b98115ecdd1aee2..e416fc63acaf847c2193af1a620bb4f1d89abc0f 100644 (file)
@@ -42,7 +42,8 @@ public abstract class AbstractVersionException extends Exception {
      *
      * @return Closest supported {@link ABIVersion}
      */
-    public final @Nonnull ABIVersion getClosestVersion() {
+    @Nonnull
+    public final ABIVersion getClosestVersion() {
         return closestVersion;
     }
 
index 5dc630cac5f0796025f3b90ab25b7bae88288cab..19df54628fe08e72d46ab46a11579b431ae13447 100644 (file)
@@ -23,8 +23,8 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 public final class AbortLocalTransactionRequest extends AbstractLocalTransactionRequest<AbortLocalTransactionRequest> {
     private static final long serialVersionUID = 1L;
 
-    public AbortLocalTransactionRequest(final @Nonnull TransactionIdentifier identifier,
-            final @Nonnull ActorRef replyTo) {
+    public AbortLocalTransactionRequest(@Nonnull final TransactionIdentifier identifier,
+            @Nonnull final ActorRef replyTo) {
         super(identifier, 0, replyTo);
     }
-}
\ No newline at end of file
+}
index 0fbeecc02336fbc19bbb514c9404869261de6aca..f6ba2e7970b1435a741cb5b9c41fa6c3cf5728d6 100644 (file)
@@ -19,10 +19,11 @@ import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifie
  *
  * @param <T> Message type
  */
-abstract class AbstractLocalHistoryRequestProxy<T extends LocalHistoryRequest<T>> extends AbstractRequestProxy<LocalHistoryIdentifier, T> {
+abstract class AbstractLocalHistoryRequestProxy<T extends LocalHistoryRequest<T>>
+        extends AbstractRequestProxy<LocalHistoryIdentifier, T> {
     private static final long serialVersionUID = 1L;
 
-    AbstractLocalHistoryRequestProxy() {
+    protected AbstractLocalHistoryRequestProxy() {
         // For Externalizable
     }
 
index bc9bb6225b6ac99a998f257c124b031e3b0a29e4..55225a74424c6ea74b0dc0f4ae3c329efcc437c3 100644 (file)
@@ -20,10 +20,12 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
  *
  * @param <T> Message type
  */
-abstract class AbstractLocalTransactionRequest<T extends AbstractLocalTransactionRequest<T>> extends TransactionRequest<T> {
+abstract class AbstractLocalTransactionRequest<T extends AbstractLocalTransactionRequest<T>>
+        extends TransactionRequest<T> {
     private static final long serialVersionUID = 1L;
 
-    AbstractLocalTransactionRequest(final TransactionIdentifier identifier, final long sequence, final ActorRef replyTo) {
+    AbstractLocalTransactionRequest(final TransactionIdentifier identifier, final long sequence,
+            final ActorRef replyTo) {
         super(identifier, sequence, replyTo);
     }
 
index a8fbbcfb3300433b2176ae9bbabdac1da8d70226..17054f78a25725ae43ff1631bc3332512d74c494 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  * Abstract base class for {@link TransactionRequest}s accessing data as visible in the isolated context of a particular
  * transaction. The path of the data being accessed is returned via {@link #getPath()}.
  *
+ * <p>
  * This class is visible outside of this package for the purpose of allowing common instanceof checks
  * and simplified codepaths.
  *
@@ -28,7 +29,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  * @param <T> Message type
  */
 @Beta
-public abstract class AbstractReadTransactionRequest<T extends AbstractReadTransactionRequest<T>> extends TransactionRequest<T> {
+public abstract class AbstractReadTransactionRequest<T extends AbstractReadTransactionRequest<T>>
+        extends TransactionRequest<T> {
     private static final long serialVersionUID = 1L;
     private final YangInstanceIdentifier path;
 
@@ -43,7 +45,8 @@ public abstract class AbstractReadTransactionRequest<T extends AbstractReadTrans
         this.path = request.getPath();
     }
 
-    public final @Nonnull YangInstanceIdentifier getPath() {
+    @Nonnull
+    public final YangInstanceIdentifier getPath() {
         return path;
     }
 
index e2d07f13b604e03bea930e5fef25f240e404ecf2..b73928574f53d9a9864ed81104fa28dd4436d1d5 100644 (file)
@@ -24,11 +24,12 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
  *
  * @param <T> Message type
  */
-abstract class AbstractReadTransactionRequestProxyV1<T extends AbstractReadTransactionRequest<T>> extends AbstractTransactionRequestProxy<T> {
+abstract class AbstractReadTransactionRequestProxyV1<T extends AbstractReadTransactionRequest<T>>
+        extends AbstractTransactionRequestProxy<T> {
     private static final long serialVersionUID = 1L;
     private YangInstanceIdentifier path;
 
-    AbstractReadTransactionRequestProxyV1() {
+    protected AbstractReadTransactionRequestProxyV1() {
         // For Externalizable
     }
 
@@ -56,5 +57,5 @@ abstract class AbstractReadTransactionRequestProxyV1<T extends AbstractReadTrans
     }
 
     abstract T createReadRequest(TransactionIdentifier target, long sequence, ActorRef replyTo,
-            YangInstanceIdentifier path);
+            YangInstanceIdentifier requestPath);
 }
index c9e8d5a26ce418ae150ea51e575ba62975a3b4bb..437d281e1848f93eb64db58a7c63389117069340 100644 (file)
@@ -19,10 +19,11 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
  *
  * @param <T> Message type
  */
-abstract class AbstractTransactionRequestProxy<T extends TransactionRequest<T>> extends AbstractRequestProxy<TransactionIdentifier, T> {
+abstract class AbstractTransactionRequestProxy<T extends TransactionRequest<T>>
+        extends AbstractRequestProxy<TransactionIdentifier, T> {
     private static final long serialVersionUID = 1L;
 
-    AbstractTransactionRequestProxy() {
+    protected AbstractTransactionRequestProxy() {
         // For Externalizable
     }
 
index a0648c975d94418a9d30bd70fd08c9e822656d79..a1284b703ff2c7d5d55f99299b4afd9513110b3f 100644 (file)
@@ -19,10 +19,11 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
  *
  * @param <T> Message type
  */
-abstract class AbstractTransactionSuccessProxy<T extends TransactionSuccess<T>> extends AbstractSuccessProxy<TransactionIdentifier, T> {
+abstract class AbstractTransactionSuccessProxy<T extends TransactionSuccess<T>>
+        extends AbstractSuccessProxy<TransactionIdentifier, T> {
     private static final long serialVersionUID = 1L;
 
-    AbstractTransactionSuccessProxy() {
+    protected AbstractTransactionSuccessProxy() {
         // For Externalizable
     }
 
index 1cb7bb1c695e91b1dfeb6367c65150465e1118bb..a1aa3995a2d6dade23ab891018dca312cce7d15b 100644 (file)
@@ -22,13 +22,14 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification
  * @author Robert Varga
  */
 @Beta
-public final class CommitLocalTransactionRequest extends AbstractLocalTransactionRequest<CommitLocalTransactionRequest> {
+public final class CommitLocalTransactionRequest
+        extends AbstractLocalTransactionRequest<CommitLocalTransactionRequest> {
     private static final long serialVersionUID = 1L;
     private final DataTreeModification mod;
     private final boolean coordinated;
 
-    public CommitLocalTransactionRequest(final @Nonnull TransactionIdentifier identifier,
-            final @Nonnull ActorRef replyTo, final @Nonnull DataTreeModification mod, final boolean coordinated) {
+    public CommitLocalTransactionRequest(@Nonnull final TransactionIdentifier identifier,
+            @Nonnull final ActorRef replyTo, @Nonnull final DataTreeModification mod, final boolean coordinated) {
         super(identifier, 0, replyTo);
         this.mod = Preconditions.checkNotNull(mod);
         this.coordinated = coordinated;
@@ -54,4 +55,4 @@ public final class CommitLocalTransactionRequest extends AbstractLocalTransactio
     protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
         return super.addToStringAttributes(toStringHelper).add("coordinated", coordinated);
     }
-}
\ No newline at end of file
+}
index 7059fe7ec1180430ee197a2da4971b6e6c28f625..55efb283c072f8d9121b399a6c341652aea468c0 100644 (file)
@@ -20,6 +20,9 @@ import org.opendaylight.controller.cluster.access.concepts.RequestException;
  * @author Robert Varga
  */
 final class ConnectClientFailureProxyV1 extends AbstractRequestFailureProxy<ClientIdentifier, ConnectClientFailure> {
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ConnectClientFailureProxyV1() {
         // For Externalizable
     }
index 45e7ba89b6c8ce8e78155bf190415e7a4ec01048..be888e2e7e3b1bd78d76625c1993a65d359c31bd 100644 (file)
@@ -24,6 +24,7 @@ import org.opendaylight.controller.cluster.access.concepts.RequestException;
  * - its minimum supported ABI version
  * - its maximum supported ABI version
  *
+ * <p>
  * It also includes request stream sequencing information.
  *
  * @author Robert Varga
@@ -62,12 +63,13 @@ public final class ConnectClientRequest extends Request<ClientIdentifier, Connec
     }
 
     @Override
-    public final ConnectClientFailure toRequestFailure(final RequestException cause) {
+    public ConnectClientFailure toRequestFailure(final RequestException cause) {
         return new ConnectClientFailure(getTarget(), getSequence(), cause);
     }
 
     @Override
-    protected AbstractRequestProxy<ClientIdentifier, ConnectClientRequest> externalizableProxy(final ABIVersion version) {
+    protected AbstractRequestProxy<ClientIdentifier, ConnectClientRequest> externalizableProxy(
+            final ABIVersion version) {
         return new ConnectClientRequestProxyV1(this);
     }
 
@@ -77,7 +79,8 @@ public final class ConnectClientRequest extends Request<ClientIdentifier, Connec
     }
 
     @Override
-    protected @Nonnull ToStringHelper addToStringAttributes(final @Nonnull ToStringHelper toStringHelper) {
+    @Nonnull
+    protected ToStringHelper addToStringAttributes(@Nonnull final ToStringHelper toStringHelper) {
         return super.addToStringAttributes(toStringHelper).add("minVersion", minVersion).add("maxVersion", maxVersion);
     }
 }
index d4c8b111b3c6b2b81d42aebc31f354bef43f8944..da3a601db75669ee0bc37d2ccbeeea2d69fdf5af 100644 (file)
@@ -26,6 +26,9 @@ final class ConnectClientRequestProxyV1 extends AbstractRequestProxy<ClientIdent
     private ABIVersion minVersion;
     private ABIVersion maxVersion;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ConnectClientRequestProxyV1() {
         // for Externalizable
     }
index 65389ec17c4ca589ecc15c4895c2c69471eb9b2e..450ef4ae322d089d9045567dbf2f2aca46a17ed1 100644 (file)
@@ -47,9 +47,9 @@ public final class ConnectClientSuccess extends RequestSuccess<ClientIdentifier,
         this.maxMessages = maxMessages;
     }
 
-    public ConnectClientSuccess(final @Nonnull ClientIdentifier target, final long sequence,
-            final @Nonnull ActorRef backend, final @Nonnull List<ActorSelection> alternates,
-            final @Nonnull DataTree dataTree, final int maxMessages) {
+    public ConnectClientSuccess(@Nonnull final ClientIdentifier target, final long sequence,
+            @Nonnull final ActorRef backend, @Nonnull final List<ActorSelection> alternates,
+            @Nonnull final DataTree dataTree, final int maxMessages) {
         this(target, sequence, backend, alternates, Optional.of(dataTree), maxMessages);
     }
 
@@ -58,11 +58,13 @@ public final class ConnectClientSuccess extends RequestSuccess<ClientIdentifier,
      *
      * @return a list of known backend alternates
      */
-    public @Nonnull List<ActorSelection> getAlternates() {
+    @Nonnull
+    public List<ActorSelection> getAlternates() {
         return alternates;
     }
 
-    public @Nonnull ActorRef getBackend() {
+    @Nonnull
+    public ActorRef getBackend() {
         return backend;
     }
 
index f9fddb72766a72f3400ccb1569b330bc2e1701f8..fb44e07c102fe5d782fc8bd8d20c92b9e1496859 100644 (file)
@@ -34,6 +34,9 @@ final class ConnectClientSuccessProxyV1 extends AbstractSuccessProxy<ClientIdent
     private ActorRef backend;
     private int maxMessages;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ConnectClientSuccessProxyV1() {
         // For Externalizable
     }
index eebcf36c4db0b20295bc28ced551cdc036cd7d8e..01a110d046e16aed03d68ff355efec133a9d7453 100644 (file)
@@ -34,7 +34,8 @@ public final class CreateLocalHistoryRequest extends LocalHistoryRequest<CreateL
     }
 
     @Override
-    protected AbstractLocalHistoryRequestProxy<CreateLocalHistoryRequest> externalizableProxy(final ABIVersion version) {
+    protected AbstractLocalHistoryRequestProxy<CreateLocalHistoryRequest> externalizableProxy(
+            final ABIVersion version) {
         return new CreateLocalHistoryRequestProxyV1(this);
     }
 
index 8a17e909f11b38b31f8ef051a5dae3a6525e5505..b61c9f5309d5617e327e1f3903de41f7016c65fc 100644 (file)
@@ -19,6 +19,9 @@ import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifie
 final class CreateLocalHistoryRequestProxyV1 extends AbstractLocalHistoryRequestProxy<CreateLocalHistoryRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public CreateLocalHistoryRequestProxyV1() {
         // For Externalizable
     }
index 505ad37ac3bc36dd3657669b25aedb92e2a7044c..375128318c43cf2bdf11395fd20ec95f0c42285a 100644 (file)
@@ -21,7 +21,8 @@ import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifie
 public final class DestroyLocalHistoryRequest extends LocalHistoryRequest<DestroyLocalHistoryRequest> {
     private static final long serialVersionUID = 1L;
 
-    public DestroyLocalHistoryRequest(final LocalHistoryIdentifier target, final long sequence, final ActorRef replyTo) {
+    public DestroyLocalHistoryRequest(final LocalHistoryIdentifier target, final long sequence,
+            final ActorRef replyTo) {
         super(target, sequence, replyTo);
     }
 
@@ -30,7 +31,8 @@ public final class DestroyLocalHistoryRequest extends LocalHistoryRequest<Destro
     }
 
     @Override
-    protected AbstractLocalHistoryRequestProxy<DestroyLocalHistoryRequest> externalizableProxy(final ABIVersion version) {
+    protected AbstractLocalHistoryRequestProxy<DestroyLocalHistoryRequest> externalizableProxy(
+            final ABIVersion version) {
         return new DestroyLocalHistoryRequestProxyV1(this);
     }
 
index 845d0193e2d9b98c3b432168ce1b692fa7bbee76..0ebd69054d9ea424bd9ca6730243c8e4dad3bab3 100644 (file)
@@ -19,6 +19,9 @@ import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifie
 final class DestroyLocalHistoryRequestProxyV1 extends AbstractLocalHistoryRequestProxy<DestroyLocalHistoryRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public DestroyLocalHistoryRequestProxyV1() {
         // For Externalizable
     }
index f689e2552ff00d88fd72ab575ad7a32f9654b2bc..b8621177e28363bf762dc4997d5fa76193d048b1 100644 (file)
@@ -23,8 +23,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 public final class ExistsTransactionRequest extends AbstractReadTransactionRequest<ExistsTransactionRequest> {
     private static final long serialVersionUID = 1L;
 
-    public ExistsTransactionRequest(final @Nonnull TransactionIdentifier identifier, final long sequence,
-            final @Nonnull ActorRef replyTo, final @Nonnull YangInstanceIdentifier path) {
+    public ExistsTransactionRequest(@Nonnull final TransactionIdentifier identifier, final long sequence,
+            @Nonnull final ActorRef replyTo, @Nonnull final YangInstanceIdentifier path) {
         super(identifier, sequence, replyTo, path);
     }
 
index 84f74004fe59aa6626f724c0565e6eea2449b576..e95da8ddde7c8fe5e3d5cad6efd910f3877336d2 100644 (file)
@@ -20,6 +20,9 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 final class ExistsTransactionRequestProxyV1 extends AbstractReadTransactionRequestProxyV1<ExistsTransactionRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ExistsTransactionRequestProxyV1() {
         // For Externalizable
     }
@@ -33,4 +36,4 @@ final class ExistsTransactionRequestProxyV1 extends AbstractReadTransactionReque
             final ActorRef replyTo, final YangInstanceIdentifier path) {
         return new ExistsTransactionRequest(target, sequence, replyTo, path);
     }
-}
\ No newline at end of file
+}
index 538c1ffa7fbee1c4a9298ed8aa0e36002c151169..24de17656ddb48cfaeb24b0e8026f13b40d6d76f 100644 (file)
@@ -22,6 +22,9 @@ final class ExistsTransactionSuccessProxyV1 extends AbstractTransactionSuccessPr
     private static final long serialVersionUID = 1L;
     private boolean exists;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ExistsTransactionSuccessProxyV1() {
         // For Externalizable
     }
index 0f3e533ba2a766a48a52c4ece0ab52dd439ec6ac..0d3a687a41c8b0459ac9b82f1d8080cd7c554397 100644 (file)
@@ -19,9 +19,13 @@ import org.opendaylight.controller.cluster.access.concepts.RequestException;
  *
  * @author Robert Varga
  */
-final class LocalHistoryFailureProxyV1 extends AbstractRequestFailureProxy<LocalHistoryIdentifier, LocalHistoryFailure> {
+final class LocalHistoryFailureProxyV1 extends
+        AbstractRequestFailureProxy<LocalHistoryIdentifier, LocalHistoryFailure> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public LocalHistoryFailureProxyV1() {
         // For Externalizable
     }
index 23858b20b2221bb55b99b1477001329782fc0da1..97a7a1c8d6c7e991d4cf629a0ffbc432968c723d 100644 (file)
@@ -20,7 +20,10 @@ import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifie
 final class LocalHistorySuccessProxyV1 extends AbstractSuccessProxy<LocalHistoryIdentifier, LocalHistorySuccess> {
     private static final long serialVersionUID = 1L;
 
-    LocalHistorySuccessProxyV1() {
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
+    public LocalHistorySuccessProxyV1() {
         // For Externalizable
     }
 
@@ -29,7 +32,7 @@ final class LocalHistorySuccessProxyV1 extends AbstractSuccessProxy<LocalHistory
     }
 
     @Override
-    protected final LocalHistoryIdentifier readTarget(final DataInput in) throws IOException {
+    protected LocalHistoryIdentifier readTarget(final DataInput in) throws IOException {
         return LocalHistoryIdentifier.readFrom(in);
     }
 
index d9de3afc694eb608c2b2f3868f5e2ece31562c79..846756dc3a365d9920bd4461d535796b8a90593e 100644 (file)
@@ -32,6 +32,9 @@ final class ModifyTransactionRequestProxyV1 extends AbstractTransactionRequestPr
     private List<TransactionModification> modifications;
     private Optional<PersistenceProtocol> protocol;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ModifyTransactionRequestProxyV1() {
         // For Externalizable
     }
index 36acfb2925a66aa932812a43cc0fdc96dbff7e63..c1377fc102cf58fdbce02ebf84241407a72c8c81 100644 (file)
@@ -58,18 +58,18 @@ public enum PersistenceProtocol implements WritableObject {
         out.writeByte(byteValue());
     }
 
-    abstract byte byteValue();
-
     public static PersistenceProtocol readFrom(final DataInput in) throws IOException {
         return valueOf(in.readByte());
     }
 
+    abstract byte byteValue();
+
     static int byteValue(final PersistenceProtocol finish) {
         return finish == null ? 0 : finish.byteValue();
     }
 
-    static PersistenceProtocol valueOf(final byte b) {
-        switch (b) {
+    static PersistenceProtocol valueOf(final byte value) {
+        switch (value) {
             case 0:
                 return null;
             case 1:
@@ -79,7 +79,7 @@ public enum PersistenceProtocol implements WritableObject {
             case 3:
                 return THREE_PHASE;
             default:
-                throw new IllegalArgumentException("Unhandled byte value " + b);
+                throw new IllegalArgumentException("Unhandled byte value " + value);
         }
     }
 }
index 1ac90daa213ec6b0804b00149ea9959ccea13369..11c344f5394dbc21e0869462d3db0686219a3e3f 100644 (file)
@@ -19,6 +19,9 @@ import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifie
 final class PurgeLocalHistoryRequestProxyV1 extends AbstractLocalHistoryRequestProxy<PurgeLocalHistoryRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public PurgeLocalHistoryRequestProxyV1() {
         // For Externalizable
     }
index 2d754cbb18a60d2a84613869729f395ba15ec4e4..14bb6b4a9e300ab07aac3cc0f6f9f84b7266e8af 100644 (file)
@@ -23,8 +23,8 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 public final class ReadTransactionRequest extends AbstractReadTransactionRequest<ReadTransactionRequest> {
     private static final long serialVersionUID = 1L;
 
-    public ReadTransactionRequest(final @Nonnull TransactionIdentifier identifier, final long sequence,
-            final @Nonnull ActorRef replyTo, final @Nonnull YangInstanceIdentifier path) {
+    public ReadTransactionRequest(@Nonnull final TransactionIdentifier identifier, final long sequence,
+            @Nonnull final ActorRef replyTo, @Nonnull final YangInstanceIdentifier path) {
         super(identifier, sequence, replyTo, path);
     }
 
index 0c60b2b015380afb9d2d345b835e6a5baac9044b..a438a8b4a49706bd755497c9fb667c8f9ba8a323 100644 (file)
@@ -20,6 +20,9 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 final class ReadTransactionRequestProxyV1 extends AbstractReadTransactionRequestProxyV1<ReadTransactionRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ReadTransactionRequestProxyV1() {
         // For Externalizable
     }
@@ -33,4 +36,4 @@ final class ReadTransactionRequestProxyV1 extends AbstractReadTransactionRequest
             final ActorRef replyTo, final YangInstanceIdentifier path) {
         return new ReadTransactionRequest(target, sequence, replyTo, path);
     }
-}
\ No newline at end of file
+}
index f3d8395d6f952b51c69b16a78ca32f9078283b0b..733ce71d6c1083dc6da99a29ff22138cd94d03e3 100644 (file)
@@ -15,7 +15,8 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
- * Successful reply to an {@link ReadTransactionRequest}. It indicates presence of requested data via {@link #getData()}.
+ * Successful reply to an {@link ReadTransactionRequest}. It indicates presence of requested data via
+ * {@link #getData()}.
  *
  * @author Robert Varga
  */
index ed45695d1078d768f7bd6e5c0d8e0cab36087e11..3637aa8ac98acb2d1ba6f536f3e88b24e9353196 100644 (file)
@@ -26,6 +26,9 @@ final class ReadTransactionSuccessProxyV1 extends AbstractTransactionSuccessProx
     private static final long serialVersionUID = 1L;
     private Optional<NormalizedNode<?, ?>> data;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public ReadTransactionSuccessProxyV1() {
         // For Externalizable
     }
index 0743e3e24eeec95e27d1177450bec436a3610f47..3e67dfe83bff02992afa73dec53daa0c650be490 100644 (file)
@@ -19,6 +19,9 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 final class TransactionAbortRequestProxyV1 extends AbstractTransactionRequestProxy<TransactionAbortRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionAbortRequestProxyV1() {
         // For Externalizable
     }
index 3cf513ae3ca5af95970736be8b9a04dc07d55517..c9de3b97037aa71949b11a146cd32961ade8469b 100644 (file)
@@ -18,6 +18,9 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 final class TransactionAbortSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionAbortSuccess> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionAbortSuccessProxyV1() {
         // For Externalizable
     }
index 4e689b2ace39db9712c5f182c96fd358fd1b7380..e6149bd5da226529e746a07e09314fde37759346 100644 (file)
@@ -24,7 +24,8 @@ public final class TransactionCanCommitSuccess extends TransactionSuccess<Transa
     }
 
     @Override
-    protected AbstractTransactionSuccessProxy<TransactionCanCommitSuccess> externalizableProxy(final ABIVersion version) {
+    protected AbstractTransactionSuccessProxy<TransactionCanCommitSuccess> externalizableProxy(
+            final ABIVersion version) {
         return new TransactionCanCommitSuccessProxyV1(this);
     }
 
index b645d68885093f6f72577d74867ad8aff45ec29f..b41ec2998fd4a5e6b3616e64f90ff5cd526372da 100644 (file)
@@ -21,6 +21,9 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 final class TransactionCanCommitSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionCanCommitSuccess> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionCanCommitSuccessProxyV1() {
         // For Externalizable
     }
index aaf07c26e1301af7d69a343b97e5fafb39e36a7d..f23da7bac2b98ba719e6fde3543e41571022162a 100644 (file)
@@ -18,6 +18,9 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 final class TransactionCommitSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionCommitSuccess> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionCommitSuccessProxyV1() {
         // For Externalizable
     }
index ce9ca9b0043e80e607544578958f44b248b8ee02..fcb63fd0f58f4bef9cd035aab781f2928857984b 100644 (file)
@@ -19,6 +19,9 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 final class TransactionDoCommitRequestProxyV1 extends AbstractTransactionRequestProxy<TransactionDoCommitRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionDoCommitRequestProxyV1() {
         // For Externalizable
     }
index 15cf09c5b7677b99ca2c6e1a9390e3895f4e41fb..d3b1dd7cf791389b8402ef87209c0f582554c012 100644 (file)
@@ -22,6 +22,9 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 final class TransactionFailureProxyV1 extends AbstractRequestFailureProxy<TransactionIdentifier, TransactionFailure> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionFailureProxyV1() {
         // For Externalizable
     }
index d79dbea6423254be0a54a999f3550389f0fab022..226557d12436fca9b8cce808f2b82907559741b8 100644 (file)
@@ -21,7 +21,8 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 public final class TransactionPreCommitRequest extends TransactionRequest<TransactionPreCommitRequest> {
     private static final long serialVersionUID = 1L;
 
-    public TransactionPreCommitRequest(final TransactionIdentifier target, final long sequence, final ActorRef replyTo) {
+    public TransactionPreCommitRequest(final TransactionIdentifier target, final long sequence,
+            final ActorRef replyTo) {
         super(target, sequence, replyTo);
     }
 
index 649db56a57a4a00faf7fd882fd60f83bb340af32..bf044e1a1563330239d1fb68d5b0854a8d104ccd 100644 (file)
@@ -11,14 +11,17 @@ import akka.actor.ActorRef;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
 
 /**
- * Externalizable proxy for use with {@link TransactionPreCommitRequest}. It implements the initial (Boron) serialization
- * format.
+ * Externalizable proxy for use with {@link TransactionPreCommitRequest}. It implements the initial (Boron)
+ * serialization format.
  *
  * @author Robert Varga
  */
 final class TransactionPreCommitRequestProxyV1 extends AbstractTransactionRequestProxy<TransactionPreCommitRequest> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionPreCommitRequestProxyV1() {
         // For Externalizable
     }
index 1cf00e668fb7f3811f7959c6ec5926021bedfeb1..716f37804cc0b88f7fd0efdba345fc8de381e086 100644 (file)
@@ -23,7 +23,8 @@ public final class TransactionPreCommitSuccess extends TransactionSuccess<Transa
     }
 
     @Override
-    protected AbstractTransactionSuccessProxy<TransactionPreCommitSuccess> externalizableProxy(final ABIVersion version) {
+    protected AbstractTransactionSuccessProxy<TransactionPreCommitSuccess> externalizableProxy(
+            final ABIVersion version) {
         return new TransactionPreCommitSuccessProxyV1(this);
     }
 
index 387a60c8e9a7ae8f75205829d309a4b6bf0a3d77..17b1b8da0d27cdaa473c73ad9608a8c2900bf8a3 100644 (file)
@@ -18,6 +18,9 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
 final class TransactionPreCommitSuccessProxyV1 extends AbstractTransactionSuccessProxy<TransactionPreCommitSuccess> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public TransactionPreCommitSuccessProxyV1() {
         // For Externalizable
     }
index 77a6b56d1e44839f1e9a4c1f2d2825439a7f9894..e15c2dc7c40f8b5fb6c7680d0c513a9271aec4b3 100644 (file)
@@ -21,7 +21,8 @@ import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier
  * @param <T> Message type
  */
 @Beta
-public abstract class TransactionSuccess<T extends TransactionSuccess<T>> extends RequestSuccess<TransactionIdentifier, T> {
+public abstract class TransactionSuccess<T extends TransactionSuccess<T>>
+        extends RequestSuccess<TransactionIdentifier, T> {
     private static final long serialVersionUID = 1L;
 
     TransactionSuccess(final TransactionIdentifier identifier, final long sequence) {
index 69fc29305c2dbacad7e9e432a80d14ce77fb5bf8..326a514abc9400278d12a10be075cca10fd51769 100644 (file)
@@ -20,7 +20,7 @@ abstract class AbstractEnvelopeProxy<T extends Message<?, ?>> implements Externa
     private long sessionId;
     private long txSequence;
 
-    public AbstractEnvelopeProxy() {
+    protected AbstractEnvelopeProxy() {
         // for Externalizable
     }
 
@@ -45,9 +45,9 @@ abstract class AbstractEnvelopeProxy<T extends Message<?, ?>> implements Externa
         message = (T) in.readObject();
     }
 
-    abstract Envelope<T> createEnvelope(T message, long sessionId, long txSequence);
+    abstract Envelope<T> createEnvelope(T wrappedNessage, long envSessionId, long envTxSequence);
 
     final Object readResolve() {
         return createEnvelope(message, sessionId, txSequence);
     }
-}
\ No newline at end of file
+}
index 48ad0d39bbc333e8f6f84f63c611c3387d84213d..8a5916813629a00539d5d23f3ff4ea356181bd80 100644 (file)
@@ -34,7 +34,7 @@ abstract class AbstractMessageProxy<T extends WritableIdentifier, C extends Mess
         // For Externalizable
     }
 
-    AbstractMessageProxy(final @Nonnull C message) {
+    AbstractMessageProxy(@Nonnull final C message) {
         this.target = message.getTarget();
         this.sequence = message.getSequence();
     }
@@ -55,6 +55,9 @@ abstract class AbstractMessageProxy<T extends WritableIdentifier, C extends Mess
         return Verify.verifyNotNull(createMessage(target, sequence));
     }
 
-    protected abstract @Nonnull T readTarget(@Nonnull DataInput in) throws IOException;
-    abstract @Nonnull C createMessage(@Nonnull T target, long sequence);
-}
\ No newline at end of file
+    @Nonnull
+    protected abstract T readTarget(@Nonnull DataInput in) throws IOException;
+
+    @Nonnull
+    abstract C createMessage(@Nonnull T msgTarget, long msgSequence);
+}
index a7624a4a6335c8eed661d6190723e6893cd1836e..28d09ed627748235b79f0a62635a73ec7b4273e3 100644 (file)
@@ -31,7 +31,7 @@ public abstract class AbstractRequestFailureProxy<T extends WritableIdentifier,
         // For Externalizable
     }
 
-    protected AbstractRequestFailureProxy(final @Nonnull C failure) {
+    protected AbstractRequestFailureProxy(@Nonnull final C failure) {
         super(failure);
         this.cause = failure.getCause();
     }
@@ -53,5 +53,6 @@ public abstract class AbstractRequestFailureProxy<T extends WritableIdentifier,
         return createFailure(target, sequence, cause);
     }
 
-    protected abstract @Nonnull C createFailure(@Nonnull T target, long sequence, @Nonnull RequestException cause);
-}
\ No newline at end of file
+    @Nonnull
+    protected abstract C createFailure(@Nonnull T target, long sequence, @Nonnull RequestException failureCause);
+}
index f55b85b85945b8906243f5b62e5d2a0721372e4c..f73453f9a44bfe0ca6c49c6dd61e2326d4d2b9b9 100644 (file)
@@ -34,7 +34,7 @@ public abstract class AbstractRequestProxy<T extends WritableIdentifier, C exten
         // For Externalizable
     }
 
-    protected AbstractRequestProxy(final @Nonnull C request) {
+    protected AbstractRequestProxy(@Nonnull final C request) {
         super(request);
         this.replyTo = request.getReplyTo();
     }
@@ -52,9 +52,11 @@ public abstract class AbstractRequestProxy<T extends WritableIdentifier, C exten
     }
 
     @Override
-    final @Nonnull C createMessage(@Nonnull final T target, final long sequence) {
+    @Nonnull
+    final C createMessage(@Nonnull final T target, final long sequence) {
         return createRequest(target, sequence, replyTo);
     }
 
-    protected abstract @Nonnull C createRequest(@Nonnull T target, long sequence, @Nonnull ActorRef replyTo);
-}
\ No newline at end of file
+    @Nonnull
+    protected abstract C createRequest(@Nonnull T target, long sequence, @Nonnull ActorRef replyToActor);
+}
index 736336803de4df9620551add7964c3591c4565d5..526c97ce32b3d5dd2eabcc0443fe9efdcc39866b 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.cluster.access.concepts;
 abstract class AbstractResponseEnvelopeProxy<T extends Response<?, ?>> extends AbstractEnvelopeProxy<T> {
     private static final long serialVersionUID = 1L;
 
-    public AbstractResponseEnvelopeProxy() {
+    protected AbstractResponseEnvelopeProxy() {
         // for Externalizable
     }
 
@@ -20,4 +20,4 @@ abstract class AbstractResponseEnvelopeProxy<T extends Response<?, ?>> extends A
 
     @Override
     abstract ResponseEnvelope<T> createEnvelope(T message, long sequence, long retry);
-}
\ No newline at end of file
+}
index 351a6f882b3dd0e03ddc92ef458e0ff03198962a..b72b2b9f7c21bfecdf092e2f847e3991932d9ebd 100644 (file)
@@ -22,11 +22,11 @@ abstract class AbstractResponseProxy<T extends WritableIdentifier, C extends Res
         extends AbstractMessageProxy<T, C> {
     private static final long serialVersionUID = 1L;
 
-    AbstractResponseProxy() {
+    protected AbstractResponseProxy() {
         // for Externalizable
     }
 
-    AbstractResponseProxy(final @Nonnull C response) {
+    AbstractResponseProxy(@Nonnull final C response) {
         super(response);
     }
 
@@ -35,5 +35,6 @@ abstract class AbstractResponseProxy<T extends WritableIdentifier, C extends Res
         return createResponse(target, sequence);
     }
 
-    abstract @Nonnull C createResponse(@Nonnull T target, long sequence);
+    @Nonnull
+    abstract C createResponse(@Nonnull T target, long sequence);
 }
index f1786e07f94b11a0eefeb4569876d55dc5b61eaa..4404b01570762166b1c380bf3e4f3533d5fb2dee 100644 (file)
@@ -28,7 +28,7 @@ public abstract class AbstractSuccessProxy<T extends WritableIdentifier, C exten
         // For Externalizable
     }
 
-    protected AbstractSuccessProxy(final @Nonnull C success) {
+    protected AbstractSuccessProxy(@Nonnull final C success) {
         super(success);
     }
 
@@ -37,5 +37,6 @@ public abstract class AbstractSuccessProxy<T extends WritableIdentifier, C exten
         return createSuccess(target, sequence);
     }
 
-    protected abstract @Nonnull C createSuccess(@Nonnull T target, long sequence);
-}
\ No newline at end of file
+    @Nonnull
+    protected abstract C createSuccess(@Nonnull T target, long sequence);
+}
index 5842ade3c203f29048caa16480742dc83510a6f7..fe178f26e9d25cc0aa29202ce951b5096fd6a3c1 100644 (file)
@@ -32,6 +32,9 @@ public final class ClientIdentifier implements WritableIdentifier {
         private FrontendIdentifier frontendId;
         private long generation;
 
+        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+        // be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // Needed for Externalizable
         }
@@ -97,15 +100,15 @@ public final class ClientIdentifier implements WritableIdentifier {
     }
 
     @Override
-    public boolean equals(final Object o) {
-        if (this == o) {
+    public boolean equals(final Object obj) {
+        if (this == obj) {
             return true;
         }
-        if (!(o instanceof ClientIdentifier)) {
+        if (!(obj instanceof ClientIdentifier)) {
             return false;
         }
 
-        final ClientIdentifier other = (ClientIdentifier) o;
+        final ClientIdentifier other = (ClientIdentifier) obj;
         return generation == other.generation && frontendId.equals(other.frontendId);
     }
 
index 5f2d15d60797b184d978dc0620aa5ccf467446d1..02686d9708254acac8373ed32ee0604f4f7ad7fa 100644 (file)
@@ -26,7 +26,7 @@ public abstract class Envelope<T extends Message<?, ?>> implements Immutable, Se
     }
 
     /**
-     * Get the enclosed message
+     * Get the enclosed message.
      *
      * @return enclose message
      */
index 892b44d33bd70f4b8d8a5608c1534bd864d9d700..b9ba98e1c55531a80dd6ed9b04232350d9b6f9b9 100644 (file)
@@ -10,6 +10,9 @@ package org.opendaylight.controller.cluster.access.concepts;
 final class FailureEnvelopeProxy extends AbstractResponseEnvelopeProxy<RequestFailure<?, ?>> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to be
+    // able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public FailureEnvelopeProxy() {
         // for Externalizable
     }
index fc728130e644f91a13462c9fd7ecbb789964d7ad..60e40e9e161faf74c5f82c7fdd564c1872d916f9 100644 (file)
@@ -30,6 +30,9 @@ public final class FrontendIdentifier implements WritableIdentifier {
         private MemberName memberName;
         private FrontendType clientType;
 
+        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+        // be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // Needed for Externalizable
         }
@@ -95,15 +98,15 @@ public final class FrontendIdentifier implements WritableIdentifier {
     }
 
     @Override
-    public boolean equals(final Object o) {
-        if (this == o) {
+    public boolean equals(final Object obj) {
+        if (this == obj) {
             return true;
         }
-        if (!(o instanceof FrontendIdentifier)) {
+        if (!(obj instanceof FrontendIdentifier)) {
             return false;
         }
 
-        final FrontendIdentifier other = (FrontendIdentifier) o;
+        final FrontendIdentifier other = (FrontendIdentifier) obj;
         return memberName.equals(other.memberName) && clientType.equals(other.clientType);
     }
 
index 52b6ccc6c82dc8fef81e14e2faf0f448a024c636..b58e24087484bca7616275a440e462a791f657d2 100644 (file)
@@ -37,6 +37,9 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
         private static final long serialVersionUID = 1L;
         private byte[] serialized;
 
+        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+        // be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // For Externalizable
         }
@@ -85,6 +88,7 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
      * - US-ASCII letters and numbers
      * - special characters: -_.*+:=,!~';
      *
+     * @param name the input name
      * @return A {@link FrontendType} instance
      * @throws IllegalArgumentException if the string is null, empty or contains invalid characters
      */
@@ -103,9 +107,9 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
 
     @Override
     public void writeTo(final DataOutput out) throws IOException {
-        final byte[] serialized = getSerialized();
-        out.writeInt(serialized.length);
-        out.write(serialized);
+        final byte[] local = getSerialized();
+        out.writeInt(local.length);
+        out.write(local);
     }
 
     public String getName() {
@@ -118,13 +122,13 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
     }
 
     @Override
-    public boolean equals(final Object o) {
-        return this == o || (o instanceof FrontendType && name.equals(((FrontendType)o).name));
+    public boolean equals(final Object obj) {
+        return this == obj || obj instanceof FrontendType && name.equals(((FrontendType)obj).name);
     }
 
     @Override
-    public int compareTo(final FrontendType o) {
-        return this == o ? 0 : name.compareTo(o.name);
+    public int compareTo(final FrontendType obj) {
+        return this == obj ? 0 : name.compareTo(obj.name);
     }
 
     @Override
index a6e81f13aa111134570354241895e5c2a37316e3..29e3df74f5657a9697731d4cdc60c526a8baf14d 100644 (file)
@@ -42,6 +42,9 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
         private long historyId;
         private long cookie;
 
+        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+        // be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // For Externalizable
         }
@@ -122,15 +125,15 @@ public final class LocalHistoryIdentifier implements WritableIdentifier {
     }
 
     @Override
-    public boolean equals(final Object o) {
-        if (this == o) {
+    public boolean equals(final Object obj) {
+        if (this == obj) {
             return true;
         }
-        if (!(o instanceof LocalHistoryIdentifier)) {
+        if (!(obj instanceof LocalHistoryIdentifier)) {
             return false;
         }
 
-        final LocalHistoryIdentifier other = (LocalHistoryIdentifier) o;
+        final LocalHistoryIdentifier other = (LocalHistoryIdentifier) obj;
         return historyId == other.historyId && cookie == other.cookie && clientId.equals(other.clientId);
     }
 
index 2b1a642029f670809b167dbfce86287d64b2a3db..55737c47b7f62ad548e86b3d693d349ed5789ca6 100644 (file)
@@ -32,6 +32,9 @@ public final class MemberName implements Comparable<MemberName>, WritableIdentif
         private static final long serialVersionUID = 1L;
         private byte[] serialized;
 
+        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+        // be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // For Externalizable
         }
@@ -85,9 +88,9 @@ public final class MemberName implements Comparable<MemberName>, WritableIdentif
 
     @Override
     public void writeTo(final DataOutput out) throws IOException {
-        final byte[] serialized = getSerialized();
-        out.writeInt(serialized.length);
-        out.write(serialized);
+        final byte[] local = getSerialized();
+        out.writeInt(local.length);
+        out.write(local);
     }
 
     public String getName() {
@@ -100,13 +103,13 @@ public final class MemberName implements Comparable<MemberName>, WritableIdentif
     }
 
     @Override
-    public boolean equals(final Object o) {
-        return this == o || (o instanceof MemberName && name.equals(((MemberName)o).name));
+    public boolean equals(final Object obj) {
+        return this == obj || obj instanceof MemberName && name.equals(((MemberName)obj).name);
     }
 
     @Override
-    public int compareTo(final MemberName o) {
-        return this == o ? 0 : name.compareTo(o.name);
+    public int compareTo(final MemberName obj) {
+        return this == obj ? 0 : name.compareTo(obj.name);
     }
 
     @Override
index 30e631eed7b0e9f46ba5e5fd2a72e985d9981233..8788c0df989e248d1eddad1be62b16a46237644a 100644 (file)
@@ -23,21 +23,26 @@ import org.opendaylight.yangtools.concepts.WritableIdentifier;
  * An abstract concept of a Message. This class cannot be instantiated directly, use its specializations {@link Request}
  * and {@link Response}.
  *
+ * <p>
  * Messages have a target and a sequence number. Sequence numbers are expected to be assigned monotonically on a
  * per-target basis, hence two targets can observe the same sequence number.
  *
+ * <p>
  * This class includes explicit versioning for forward- and backward- compatibility of serialization format. This is
  * achieved by using the serialization proxy pattern. Subclasses are in complete control of what proxy is used to
  * serialize a particular object on the wire. This class can serve as an explicit version marker, hence no further
  * action is necessary in the deserialization path.
  *
+ * <p>
  * For the serialization path an explicit call from the user is required to select the appropriate serialization
  * version. This is done via {@link #toVersion(ABIVersion)} method, which should return a copy of this object with
  * the requested ABI version recorded and should return the appropriate serialization proxy.
  *
+ * <p>
  * This workflow allows least disturbance across ABI versions, as all messages not affected by a ABI version bump
  * will remain working with the same serialization format for the new ABI version.
  *
+ * <p>
  * Note that this class specifies the {@link Immutable} contract, which means that all subclasses must follow this API
  * contract.
  *
@@ -74,7 +79,8 @@ public abstract class Message<T extends WritableIdentifier, C extends Message<T,
      *
      * @return Target identifier
      */
-    public final @Nonnull T getTarget() {
+    @Nonnull
+    public final T getTarget() {
         return target;
     }
 
@@ -88,32 +94,35 @@ public abstract class Message<T extends WritableIdentifier, C extends Message<T,
     }
 
     @VisibleForTesting
-    public final @Nonnull ABIVersion getVersion() {
+    @Nonnull
+    public final ABIVersion getVersion() {
         return version;
     }
 
     /**
      * Return a message which will end up being serialized in the specified {@link ABIVersion}.
      *
-     * @param version Request {@link ABIVersion}
+     * @param toVersion Request {@link ABIVersion}
      * @return A new message which will use ABIVersion as its serialization.
      */
     @SuppressWarnings("unchecked")
-    public final @Nonnull C toVersion(final @Nonnull ABIVersion version) {
-        if (this.version == version) {
+    @Nonnull
+    public final C toVersion(@Nonnull final ABIVersion toVersion) {
+        if (this.version == toVersion) {
             return (C)this;
         }
 
-        switch (version) {
+        switch (toVersion) {
             case BORON:
-                return Verify.verifyNotNull(cloneAsVersion(version));
+                return Verify.verifyNotNull(cloneAsVersion(toVersion));
             case TEST_PAST_VERSION:
             case TEST_FUTURE_VERSION:
+            default:
                 // Fall-through to throw
                 break;
         }
 
-        throw new IllegalArgumentException("Unhandled ABI version " + version);
+        throw new IllegalArgumentException("Unhandled ABI version " + toVersion);
     }
 
     /**
@@ -121,11 +130,12 @@ public abstract class Message<T extends WritableIdentifier, C extends Message<T,
      * method should be implemented by the concrete final message class and should invoke the equivalent of
      * {@link #Message(Message, ABIVersion)}.
      *
-     * @param version target ABI version
+     * @param targetVersion target ABI version
      * @return A message with the specified serialization stream
      * @throws IllegalArgumentException if this message does not support the target ABI
      */
-    protected abstract @Nonnull C cloneAsVersion(@Nonnull ABIVersion version);
+    @Nonnull
+    protected abstract C cloneAsVersion(@Nonnull ABIVersion targetVersion);
 
     @Override
     public final String toString() {
@@ -140,7 +150,8 @@ public abstract class Message<T extends WritableIdentifier, C extends Message<T,
      * @return The {@link ToStringHelper} passed in as argument
      * @throws NullPointerException if toStringHelper is null
      */
-    protected @Nonnull ToStringHelper addToStringAttributes(final @Nonnull ToStringHelper toStringHelper) {
+    @Nonnull
+    protected ToStringHelper addToStringAttributes(@Nonnull final ToStringHelper toStringHelper) {
         return toStringHelper.add("target", target).add("sequence", Long.toUnsignedString(sequence));
     }
 
@@ -149,10 +160,11 @@ public abstract class Message<T extends WritableIdentifier, C extends Message<T,
      * different objects for incompatible {@link ABIVersion}s. This method should never fail, as any compatibility
      * checks should have been done by {@link #cloneAsVersion(ABIVersion)}.
      *
-     * @param version Requested ABI version
+     * @param reqVersion Requested ABI version
      * @return Proxy for this object
      */
-    abstract @Nonnull AbstractMessageProxy<T, C> externalizableProxy(@Nonnull ABIVersion version);
+    @Nonnull
+    abstract AbstractMessageProxy<T, C> externalizableProxy(@Nonnull ABIVersion reqVersion);
 
     protected final Object writeReplace() {
         return externalizableProxy(version);
index 2f5cb4f4becaa84e1fd6677d93dd7d2375d27442..75fbadd00a702c0f5129a0a13686e2901382f823 100644 (file)
@@ -29,12 +29,12 @@ public abstract class Request<T extends WritableIdentifier, C extends Request<T,
     private static final long serialVersionUID = 1L;
     private final ActorRef replyTo;
 
-    protected Request(final @Nonnull T target, final long sequence, final @Nonnull ActorRef replyTo) {
+    protected Request(@Nonnull final T target, final long sequence, @Nonnull final ActorRef replyTo) {
         super(target, sequence);
         this.replyTo = Preconditions.checkNotNull(replyTo);
     }
 
-    protected Request(final @Nonnull C request, final @Nonnull ABIVersion version) {
+    protected Request(@Nonnull final C request, @Nonnull final ABIVersion version) {
         super(request, version);
         this.replyTo = Preconditions.checkNotNull(request.getReplyTo());
     }
@@ -44,7 +44,8 @@ public abstract class Request<T extends WritableIdentifier, C extends Request<T,
      *
      * @return Original requestor
      */
-    public final @Nonnull ActorRef getReplyTo() {
+    @Nonnull
+    public final ActorRef getReplyTo() {
         return replyTo;
     }
 
@@ -54,7 +55,8 @@ public abstract class Request<T extends WritableIdentifier, C extends Request<T,
      * @param cause Failure cause
      * @return {@link RequestFailure} corresponding to this request
      */
-    public abstract @Nonnull RequestFailure<T, ?> toRequestFailure(final @Nonnull RequestException cause);
+    @Nonnull
+    public abstract RequestFailure<T, ?> toRequestFailure(@Nonnull final RequestException cause);
 
     @Override
     protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
index 8ab450d8d34adb950824dd3e11c058e6e22d6ec1..66e7eaa0a2fa28268deabc33f0ccda5b69c24655 100644 (file)
@@ -10,6 +10,9 @@ package org.opendaylight.controller.cluster.access.concepts;
 final class RequestEnvelopeProxy extends AbstractEnvelopeProxy<Request<?, ?>> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public RequestEnvelopeProxy() {
         // for Externalizable
     }
index ec519128414bc22c75ff53c6345223c7d33ab35d..f3b3d734212ed5daab539f07dff0bb242ed30a7b 100644 (file)
@@ -20,11 +20,11 @@ import javax.annotation.Nonnull;
 public abstract class RequestException extends Exception {
     private static final long serialVersionUID = 1L;
 
-    protected RequestException(final @Nonnull String message) {
+    protected RequestException(@Nonnull final String message) {
         super(Preconditions.checkNotNull(message));
     }
 
-    protected RequestException(final @Nonnull String message, final @Nonnull Exception cause) {
+    protected RequestException(@Nonnull final String message, @Nonnull final Exception cause) {
         super(Preconditions.checkNotNull(message), Preconditions.checkNotNull(cause));
     }
 
index ecd2ff495542a78699948167fbe48db176e07c29..13eb4bc618864b52c5ad46eec0783bf7bf72a092 100644 (file)
@@ -23,16 +23,17 @@ import org.opendaylight.yangtools.concepts.WritableIdentifier;
  * @param <C> Message class
  */
 @Beta
-public abstract class RequestFailure<T extends WritableIdentifier, C extends RequestFailure<T, C>> extends Response<T, C> {
+public abstract class RequestFailure<T extends WritableIdentifier, C extends RequestFailure<T, C>>
+        extends Response<T, C> {
     private static final long serialVersionUID = 1L;
     private final RequestException cause;
 
-    protected RequestFailure(final @Nonnull C failure, final @Nonnull ABIVersion version) {
+    protected RequestFailure(@Nonnull final C failure, @Nonnull final ABIVersion version) {
         super(failure, version);
         this.cause = Preconditions.checkNotNull(failure.getCause());
     }
 
-    protected RequestFailure(final @Nonnull T target, final long sequence, final @Nonnull RequestException cause) {
+    protected RequestFailure(@Nonnull final T target, final long sequence, @Nonnull final RequestException cause) {
         super(target, sequence);
         this.cause = Preconditions.checkNotNull(cause);
     }
@@ -42,7 +43,8 @@ public abstract class RequestFailure<T extends WritableIdentifier, C extends Req
      *
      * @return Failure cause.
      */
-    public final @Nonnull RequestException getCause() {
+    @Nonnull
+    public final RequestException getCause() {
         return cause;
     }
 
index ad9402f93825af3ff8d271d6285600ddb1ca3756..65d43184cce42de55be52770015f6f77a4041ce6 100644 (file)
@@ -24,11 +24,11 @@ public abstract class RequestSuccess<T extends WritableIdentifier, C extends Req
         Response<T, C> {
     private static final long serialVersionUID = 1L;
 
-    protected RequestSuccess(final @Nonnull C success, final @Nonnull ABIVersion version) {
+    protected RequestSuccess(@Nonnull final C success, @Nonnull final ABIVersion version) {
         super(success, version);
     }
 
-    protected RequestSuccess(final @Nonnull T target, final long sequence) {
+    protected RequestSuccess(@Nonnull final T target, final long sequence) {
         super(target, sequence);
     }
 
index c520da19b70e5f8d9b628d05f5dd209f97d49c71..cc6188bd84d8a0032f6169d700aeb56bd8dbc0d5 100644 (file)
@@ -26,11 +26,11 @@ import org.opendaylight.yangtools.concepts.WritableIdentifier;
 public abstract class Response<T extends WritableIdentifier, C extends Response<T, C>> extends Message<T, C> {
     private static final long serialVersionUID = 1L;
 
-    Response(final @Nonnull T target, final long sequence) {
+    Response(@Nonnull final T target, final long sequence) {
         super(target, sequence);
     }
 
-    Response(final @Nonnull C response, final @Nonnull ABIVersion version) {
+    Response(@Nonnull final C response, @Nonnull final ABIVersion version) {
         super(response, version);
     }
 
index 50df24771f1a533c06abbe1bcaf21c2a7c11d334..b9d6183f9e68cb11569ab603042fed5149e87194 100644 (file)
@@ -10,6 +10,9 @@ package org.opendaylight.controller.cluster.access.concepts;
 final class SuccessEnvelopeProxy extends AbstractResponseEnvelopeProxy<RequestSuccess<?, ?>> {
     private static final long serialVersionUID = 1L;
 
+    // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+    // be able to create instances via reflection.
+    @SuppressWarnings("checkstyle:RedundantModifier")
     public SuccessEnvelopeProxy() {
         // for Externalizable
     }
index dac331462833ceee613a0ba89c7ff8a0bec1aa0c..202b5ce6dc53fbe2b3946727b419f3d928d27b1c 100644 (file)
@@ -31,6 +31,9 @@ public final class TransactionIdentifier implements WritableIdentifier {
         private LocalHistoryIdentifier historyId;
         private long transactionId;
 
+        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+        // be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // For Externalizable
         }
@@ -62,7 +65,7 @@ public final class TransactionIdentifier implements WritableIdentifier {
     private final long transactionId;
     private transient String shortString;
 
-    public TransactionIdentifier(final @Nonnull LocalHistoryIdentifier historyId, final long transactionId) {
+    public TransactionIdentifier(@Nonnull final LocalHistoryIdentifier historyId, final long transactionId) {
         this.historyId = Preconditions.checkNotNull(historyId);
         this.transactionId = transactionId;
     }
@@ -92,24 +95,24 @@ public final class TransactionIdentifier implements WritableIdentifier {
     }
 
     @Override
-    public boolean equals(final Object o) {
-        if (this == o) {
+    public boolean equals(final Object obj) {
+        if (this == obj) {
             return true;
         }
-        if (!(o instanceof TransactionIdentifier)) {
+        if (!(obj instanceof TransactionIdentifier)) {
             return false;
         }
 
-        final TransactionIdentifier other = (TransactionIdentifier) o;
+        final TransactionIdentifier other = (TransactionIdentifier) obj;
         return transactionId == other.transactionId && historyId.equals(other.historyId);
     }
 
     public String toShortString() {
-        if(shortString == null) {
+        if (shortString == null) {
             String histStr = historyId.getHistoryId() == 0 ? "" : "-chn-" + historyId.getHistoryId();
-            shortString = historyId.getClientId().getFrontendId().getMemberName().getName() + "-" +
-                    historyId.getClientId().getFrontendId().getClientType().getName() + "-fe-" +
-                    historyId.getClientId().getGeneration() + histStr + "-txn-" + transactionId;
+            shortString = historyId.getClientId().getFrontendId().getMemberName().getName() + "-"
+                    + historyId.getClientId().getFrontendId().getClientType().getName() + "-fe-"
+                    historyId.getClientId().getGeneration() + histStr + "-txn-" + transactionId;
         }
 
         return shortString;
index 6866136496d8764edc37472280a14b1ed77ea0a4..f9e9c0c95473e7d39f7bd4315ae2a434f32aba4d 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertTrue;
 import static org.opendaylight.controller.cluster.access.ABIVersion.BORON;
 import static org.opendaylight.controller.cluster.access.ABIVersion.TEST_FUTURE_VERSION;
 import static org.opendaylight.controller.cluster.access.ABIVersion.TEST_PAST_VERSION;
+
 import com.google.common.io.ByteArrayDataOutput;
 import com.google.common.io.ByteStreams;
 import java.io.IOException;
@@ -32,12 +33,12 @@ public class ABIVersionTest {
         assertEquals(BORON, ABIVersion.readFrom(ByteStreams.newDataInput(writeVersion(BORON))));
     }
 
-    @Test(expected=PastVersionException.class)
+    @Test(expected = PastVersionException.class)
     public void testInvalidPastVersion() throws Exception {
         ABIVersion.valueOf(TEST_PAST_VERSION.shortValue());
     }
 
-    @Test(expected=FutureVersionException.class)
+    @Test(expected = FutureVersionException.class)
     public void testInvalidFutureVersion() throws Exception {
         ABIVersion.valueOf(TEST_FUTURE_VERSION.shortValue());
     }
@@ -48,7 +49,7 @@ public class ABIVersionTest {
         return bado.toByteArray();
     }
 
-    @Test(expected=IOException.class)
+    @Test(expected = IOException.class)
     public void testBadRead() throws IOException {
         ABIVersion.readFrom(ByteStreams.newDataInput(writeVersion(TEST_PAST_VERSION)));
     }
index 34ce489793a1f2f1190944ed18610bbfd71abcb8..080e1e46b4854a74615e1ac8d9a08bd3066cb01c 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.cluster.access.concepts;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -20,7 +21,9 @@ import org.opendaylight.yangtools.concepts.Identifier;
 
 public abstract class AbstractIdentifierTest<T extends Identifier> {
     abstract T object();
+
     abstract T differentObject();
+
     abstract T equalObject();
 
     @Test
@@ -38,10 +41,10 @@ public abstract class AbstractIdentifierTest<T extends Identifier> {
     }
 
     @SuppressWarnings("unchecked")
-    private static <T> T copy(T o) throws IOException, ClassNotFoundException {
+    private static <T> T copy(T obj) throws IOException, ClassNotFoundException {
         final ByteArrayOutputStream bos = new ByteArrayOutputStream();
         try (ObjectOutputStream oos = new ObjectOutputStream(bos)) {
-            oos.writeObject(o);
+            oos.writeObject(obj);
         }
 
         try (ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray()))) {
index e5031fc15a14873ab5a31356894148d25fe135dc..2c377e5efd14d32ad08b038d66854db58adc7963 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.cluster.access.concepts;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
+
 import org.junit.Test;
 
 public class MemberNameTest extends AbstractIdentifierTest<MemberName> {