Remove @ThreadSafe annotations from CodecCaches 01/81101/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 21 Mar 2019 16:42:50 +0000 (17:42 +0100)
committerRobert Varga <nite@hq.sk>
Fri, 22 Mar 2019 00:10:11 +0000 (00:10 +0000)
The documentation mentions these are thread-safe, there is no
point to keep JSR305 around.

Change-Id: Ide63bd3923ee61539e93fe6b259b0c00e736de7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/codec/NoopCodecCache.java
yang/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/codec/PrecomputedCodecCache.java
yang/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/codec/SharedCodecCache.java

index ef645cb0b555695e361b93b877393ad7849c1b69..8274391c599793458eb7a530d6737c53cf201767 100644 (file)
@@ -8,19 +8,17 @@
 package org.opendaylight.yangtools.yang.data.util.codec;
 
 import com.google.common.annotations.Beta;
-import javax.annotation.concurrent.ThreadSafe;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.TypedDataSchemaNode;
 
 /**
- * A no-operation codec cache.
+ * A no-operation codec cache. This class is thread-safe.
  *
  * @author Robert Varga
  *
  * @param <T> Codec type
  */
 @Beta
-@ThreadSafe
 public final class NoopCodecCache<T> extends CodecCache<T> {
     private static final NoopCodecCache<?> INSTANCE = new NoopCodecCache<>();
 
index 99d4cab50ab5e08a9c894f4e41e407a4767ee816..3db5eceeece35ff01903d808a9806c06642fc587 100644 (file)
@@ -12,13 +12,12 @@ import static java.util.Objects.requireNonNull;
 
 import com.google.common.annotations.Beta;
 import java.util.Map;
-import javax.annotation.concurrent.ThreadSafe;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.TypedDataSchemaNode;
 
 /**
- * Pre-computed CodecCache. All possible codecs are created upfront at instantiation time, after which they are
- * available for the cost of a constant lookup.
+ * Pre-computed thread-safe CodecCache. All possible codecs are created upfront at instantiation time, after which they
+ * are available for the cost of a constant lookup.
  *
  * <p>
  * Instantiation needs to occur through {@link LazyCodecCache#toPrecomputed()} after the lazy cache has been fully
@@ -27,7 +26,6 @@ import org.opendaylight.yangtools.yang.model.api.TypedDataSchemaNode;
  * @author Robert Varga
  */
 @Beta
-@ThreadSafe
 public final class PrecomputedCodecCache<T> extends CodecCache<T> {
     private final Map<TypeDefinition<?>, T> simpleCodecs;
     private final Map<TypedDataSchemaNode, T> complexCodecs;
index de30249a0f2edc412a410b29531fd3a007daf6d2..a162941eb4c6a237544c0244b6762f8b798e092e 100644 (file)
@@ -12,7 +12,6 @@ import com.google.common.base.Throwables;
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
 import java.util.concurrent.ExecutionException;
-import javax.annotation.concurrent.ThreadSafe;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.TypedDataSchemaNode;
 
@@ -22,7 +21,6 @@ import org.opendaylight.yangtools.yang.model.api.TypedDataSchemaNode;
  * @author Robert Varga
  */
 @Beta
-@ThreadSafe
 public final class SharedCodecCache<T> extends CodecCache<T> {
     // Weak keys to force identity lookup
     // Soft values to keep unreferenced codecs around for a bit, but eventually we want them to go away