Bump odlparent to 5.0.0
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 22 Mar 2019 18:31:50 +0000 (19:31 +0100)
committerRobert Varga <nite@hq.sk>
Tue, 16 Apr 2019 08:13:31 +0000 (08:13 +0000)
This bumps odlparent references to 5.0.0, removing use of the JSR305
remnants. Also a useless javadoc plugin override is removed.

Change-Id: Iae5355e49115afdd73b60bd26ac85f7f542bbff8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
java/org/opendaylight/controller/cluster/common/actor/MessageTracker.java
java/org/opendaylight/controller/cluster/datastore/util/AbstractDataTreeModificationCursor.java
java/org/opendaylight/controller/cluster/io/FileBackedOutputStream.java
java/org/opendaylight/controller/cluster/messaging/AssembledMessageState.java
java/org/opendaylight/controller/cluster/messaging/SlicedMessageState.java

index 65cef56a2bb9624a7b30d847b5932d1c79f82d14..d8f2eaa9c8a7e8baf21eb93bbaa3fed6ae4e5918 100644 (file)
@@ -20,7 +20,6 @@ import com.google.common.base.Ticker;
 import com.google.common.collect.ImmutableList;
 import java.util.LinkedList;
 import java.util.List;
-import javax.annotation.concurrent.NotThreadSafe;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,9 +52,11 @@ import org.slf4j.LoggerFactory;
  *     }
  *
  * </pre>
+ *
+ * <p>
+ * This class is NOT thread-safe.
  */
 @Beta
-@NotThreadSafe
 public final class MessageTracker {
     public abstract static class Context implements AutoCloseable {
         Context() {
index ff20c0f631706adf444e68757d63e1b4d5cfb8e8..74b55cf32d5b91a71f478bb12afd72393578dbb9 100644 (file)
@@ -13,7 +13,6 @@ import static com.google.common.base.Verify.verifyNotNull;
 
 import com.google.common.annotations.Beta;
 import java.util.Optional;
-import javax.annotation.concurrent.NotThreadSafe;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -21,12 +20,11 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification
 
 /**
  * Abstract {@link DataTreeModificationCursor} which tracks the current path. Subclasses can get the current path
- * via {@link #current()}.
+ * via {@link #current()}. This class is NOT thread-safe.
  *
  * @author Thomas Pantelis
  */
 @Beta
-@NotThreadSafe
 public abstract class AbstractDataTreeModificationCursor implements DataTreeModificationCursor {
     private YangInstanceIdentifier current = YangInstanceIdentifier.EMPTY;
 
index 353a25156cc4940613a8a2a1a55b7ef8fb6c41fc..970b06f5c2fc3d4995100920efc0227d7ce8cd1c 100644 (file)
@@ -22,8 +22,8 @@ import java.io.OutputStream;
 import java.nio.file.Files;
 import java.util.Iterator;
 import java.util.Set;
-import javax.annotation.concurrent.GuardedBy;
-import javax.annotation.concurrent.ThreadSafe;
+import org.checkerframework.checker.lock.qual.GuardedBy;
+import org.checkerframework.checker.lock.qual.Holding;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.slf4j.Logger;
@@ -35,7 +35,6 @@ import org.slf4j.LoggerFactory;
  *
  * @author Thomas Pantelis
  */
-@ThreadSafe
 public class FileBackedOutputStream extends OutputStream {
     private static final Logger LOG = LoggerFactory.getLogger(FileBackedOutputStream.class);
 
@@ -77,7 +76,7 @@ public class FileBackedOutputStream extends OutputStream {
      * @param fileDirectory the directory in which to create the file if needed. If null, the default temp file
      *                      location is used.
      */
-    public FileBackedOutputStream(int fileThreshold, @Nullable String fileDirectory) {
+    public FileBackedOutputStream(final int fileThreshold, @Nullable final String fileDirectory) {
         this.fileThreshold = fileThreshold;
         this.fileDirectory = fileDirectory;
     }
@@ -118,19 +117,19 @@ public class FileBackedOutputStream extends OutputStream {
     @Override
     @SuppressFBWarnings(value = "VO_VOLATILE_INCREMENT", justification = "Findbugs erroneously complains that the "
         + "increment of count needs to be atomic even though it is inside a synchronized block.")
-    public synchronized void write(int value) throws IOException {
+    public synchronized void write(final int value) throws IOException {
         possiblySwitchToFile(1);
         out.write(value);
         count++;
     }
 
     @Override
-    public synchronized void write(byte[] bytes) throws IOException {
+    public synchronized void write(final byte[] bytes) throws IOException {
         write(bytes, 0, bytes.length);
     }
 
     @Override
-    public synchronized void write(byte[] bytes, int off, int len) throws IOException {
+    public synchronized void write(final byte[] bytes, final int off, final int len) throws IOException {
         possiblySwitchToFile(len);
         out.write(bytes, off, len);
         count += len;
@@ -180,7 +179,7 @@ public class FileBackedOutputStream extends OutputStream {
         }
     }
 
-    @GuardedBy("this")
+    @Holding("this")
     private void closeQuietly() {
         try {
             close();
@@ -192,8 +191,8 @@ public class FileBackedOutputStream extends OutputStream {
     /**
      * Checks if writing {@code len} bytes would go over threshold, and switches to file buffering if so.
      */
-    @GuardedBy("this")
-    private void possiblySwitchToFile(int len) throws IOException {
+    @Holding("this")
+    private void possiblySwitchToFile(final int len) throws IOException {
         if (out == null) {
             throw new IOException("Stream already closed");
         }
@@ -233,7 +232,7 @@ public class FileBackedOutputStream extends OutputStream {
         }
     }
 
-    private static void deleteFile(File file) {
+    private static void deleteFile(final File file) {
         if (!file.delete()) {
             LOG.warn("Could not delete temp file {}", file);
         }
@@ -258,7 +257,7 @@ public class FileBackedOutputStream extends OutputStream {
     private static class Cleanup extends FinalizablePhantomReference<FileBackedOutputStream> {
         private final File file;
 
-        Cleanup(FileBackedOutputStream referent, File file) {
+        Cleanup(final FileBackedOutputStream referent, final File file) {
             super(referent, REFERENCE_QUEUE);
             this.file = file;
 
index 16c73c715563fc7b6a2eb7dcab39db916b0ba34e..842fdafed4ed56a805cd9e026856e2e74ea7e4c4 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.io.ByteSource;
 import java.io.BufferedOutputStream;
 import java.io.IOException;
 import java.util.Arrays;
-import javax.annotation.concurrent.NotThreadSafe;
 import org.opendaylight.controller.cluster.io.FileBackedOutputStream;
 import org.opendaylight.controller.cluster.io.FileBackedOutputStreamFactory;
 import org.opendaylight.yangtools.concepts.Identifier;
@@ -20,11 +19,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Maintains the state of an assembled message.
+ * Maintains the state of an assembled message. This class is NOT thread-safe.
  *
  * @author Thomas Pantelis
  */
-@NotThreadSafe
 public class AssembledMessageState implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(AssembledMessageState.class);
 
index 8c3cb51713d53b3be32a76702c3f85a748aa540b..5be3fa46d2bcbbb5e2d7c1544702d85e23cc71cf 100644 (file)
@@ -12,19 +12,17 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Arrays;
 import java.util.function.Consumer;
-import javax.annotation.concurrent.NotThreadSafe;
 import org.opendaylight.controller.cluster.io.FileBackedOutputStream;
 import org.opendaylight.yangtools.concepts.Identifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Maintains the state of a sliced message.
+ * Maintains the state of a sliced message. This class is NOT thread-safe.
  *
  * @author Thomas Pantelis
  * @see MessageSlicer
  */
-@NotThreadSafe
 public class SlicedMessageState<T> implements AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(SlicedMessageState.class);
 
@@ -153,7 +151,7 @@ public class SlicedMessageState<T> implements AutoCloseable {
      * @param index the slice index to test
      * @return true if the index is the last slice, false otherwise
      */
-    public boolean isLastSlice(int index) {
+    public boolean isLastSlice(final int index) {
         return totalSlices == index;
     }