Promote util contracts 79/106579/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Jun 2023 07:57:12 +0000 (09:57 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Jun 2023 07:57:12 +0000 (09:57 +0200)
Remove @Beta for sufficiently-stabilized classes.

Change-Id: Ie7bd239affcf1af1449413da9c69da0fc1a46a73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/util/src/main/java/org/opendaylight/yangtools/util/EmptyDeque.java
common/util/src/main/java/org/opendaylight/yangtools/util/ImmutableOffsetMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/ModifiableMapPhase.java
common/util/src/main/java/org/opendaylight/yangtools/util/MutableOffsetMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/SharedSingletonMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/SingletonSet.java
common/util/src/main/java/org/opendaylight/yangtools/util/UnmodifiableMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/UnmodifiableMapPhase.java

index 27e40edec6f55645a71de36091c93c8257acfd4f..8f9472d2c731af1c5d2d3cf7ae75aa9cb1503b22 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.yangtools.util;
 
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.annotations.Beta;
 import java.util.AbstractQueue;
 import java.util.Collections;
 import java.util.Deque;
@@ -22,11 +21,8 @@ import org.opendaylight.yangtools.concepts.Immutable;
  * A specialized always-empty implementation of {@link java.util.Deque}. This implementation will always refuse new
  * elements in its {@link #offer(Object)} method.
 
- * @author Robert Varga
- *
  * @param <E> the type of elements held in this collection
  */
-@Beta
 public final class EmptyDeque<E> extends AbstractQueue<E> implements Deque<E>, Immutable {
     private static final EmptyDeque<?> INSTANCE = new EmptyDeque<>();
     private static final Object[] EMPTY_ARRAY = new Object[0];
index 6f9f137b3d3cd3bbdf78ca6c50e9a3b35683959d..58be1327ae4d20d131152156ed683cef434a18b5 100644 (file)
@@ -11,7 +11,6 @@ import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Verify.verifyNotNull;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.UnmodifiableIterator;
 import java.io.Serial;
@@ -38,7 +37,6 @@ import org.eclipse.jdt.annotation.Nullable;
  * @param <K> the type of keys maintained by this map
  * @param <V> the type of mapped values
  */
-@Beta
 public abstract sealed class ImmutableOffsetMap<K, V> implements UnmodifiableMapPhase<K, V>, Serializable {
     static final class Ordered<K, V> extends ImmutableOffsetMap<K, V> {
         @Serial
index cd4ba695d5bdbe8daab9b819d20364859dea82b3..50c27ca469d529231887b9222d9c58d9ed36262c 100644 (file)
@@ -7,27 +7,20 @@
  */
 package org.opendaylight.yangtools.util;
 
-import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableMap;
 import java.util.Map;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.concepts.Mutable;
 
 /**
- * A {@link Map} which can be modified and supports efficient conversion to an
- * unmodifiable map. This interface is the logical counterpart to
- * {@link UnmodifiableMapPhase}, but it does not require implementations of
- * {@link #toUnmodifiableMap()} to return an implementation of that interface.
- * The reason for that empty and singleton mappings are efficiently represented
- * as {@link ImmutableMap}, which does not implement
- * {@link UnmodifiableMapPhase}.
+ * A {@link Map} which can be modified and supports efficient conversion to an unmodifiable map. This interface is the
+ * logical counterpart to {@link UnmodifiableMapPhase}, but it does not require implementations of
+ * {@link #toUnmodifiableMap()} to return an implementation of that interface. The reason for that empty and singleton
+ * mappings are efficiently represented as {@link ImmutableMap}, which does not implement {@link UnmodifiableMapPhase}.
  *
- * @param <K>
- *            the type of keys maintained by this map
- * @param <V>
- *            the type of mapped values
+ * @param <K> the type of keys maintained by this map
+ * @param <V> the type of mapped values
  */
-@Beta
 public interface ModifiableMapPhase<K, V> extends Map<K, V>, Mutable {
     /**
      * Return an isolated unmodifiable version of this map. Returned object must not allow removal, addition or changing
index 1c7e478e3028f970969457a073025b31b82837ca..aef49eb26add26aa458886dabd7b794f30cf5540 100644 (file)
@@ -11,7 +11,6 @@ import static com.google.common.base.Preconditions.checkState;
 import static com.google.common.base.Verify.verifyNotNull;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.annotations.Beta;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.ImmutableMap;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -46,7 +45,6 @@ import org.eclipse.jdt.annotation.Nullable;
  * @param <K> the type of keys maintained by this map
  * @param <V> the type of mapped values
  */
-@Beta
 public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implements Cloneable, ModifiableMapPhase<K, V> {
     static final class Ordered<K, V> extends MutableOffsetMap<K, V> {
         Ordered() {
@@ -154,7 +152,7 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
             objects[verifyNotNull(offsets.get(e.getKey()))] = requireNonNull(e.getValue());
         }
 
-        this.needClone = false;
+        needClone = false;
     }
 
     /**
index 58e65893bcc1282ed9fee5af480eadedc76c8451..8c20269e1f89cf0bd7ba2c6579445930053aad52 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.yangtools.util;
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.annotations.Beta;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheLoader;
 import com.google.common.cache.LoadingCache;
@@ -32,7 +31,6 @@ import org.eclipse.jdt.annotation.NonNull;
  * @param <K> the type of keys maintained by this map
  * @param <V> the type of mapped values
  */
-@Beta
 public abstract sealed class SharedSingletonMap<K, V> implements Serializable, UnmodifiableMapPhase<K, V> {
     static final class Ordered<K, V> extends SharedSingletonMap<K, V> {
         @Serial
index 1d9936cea32cc177096ba4b02c15461786f51eea..6795dd8e885c3902caaa367bee19ef7da603ac1d 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.yangtools.util;
 
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.annotations.Beta;
 import com.google.common.collect.Iterators;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.Serial;
@@ -27,9 +26,8 @@ import org.opendaylight.yangtools.concepts.Immutable;
  * A {@link Set} containing a single value. For some reason neither Java nor Guava provide direct access to the retained
  * element -- which is desirable in some situations, as is the case in {@link SharedSingletonMap#entrySet()}.
  */
-@Beta
 public abstract sealed class SingletonSet<E> implements Set<E>, Immutable, Serializable {
-    @Serial
+    @java.io.Serial
     private static final long serialVersionUID = 1L;
 
     @SuppressWarnings("unchecked")
@@ -128,7 +126,7 @@ public abstract sealed class SingletonSet<E> implements Set<E>, Immutable, Seria
         return obj == this || obj instanceof Set<?> other && other.size() == 1 && otherContains(other);
     }
 
-    @Serial
+    @java.io.Serial
     final Object writeReplace() {
         return new SSv1(getElement());
     }
index 71587b022cb27b59c340a208cb9e50d9caab269c..4ec68c85334af8e75bfd59cdf5973736e56bc91d 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.yangtools.util;
 
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.annotations.Beta;
 import com.google.common.collect.ImmutableMap;
 import java.util.Collection;
 import java.util.Collections;
@@ -29,7 +28,6 @@ import org.opendaylight.yangtools.concepts.Immutable;
  * @param <K> the type of keys maintained by this map
  * @param <V> the type of mapped values
  */
-@Beta
 public final class UnmodifiableMap<K, V> implements Map<K, V>, Immutable {
     private final @NonNull Map<K, V> delegate;
 
index 98d38fadfd411fba4e53e522cda600026b8053d4..6e4090ea1da4217660ad34d646026e57e788dc3a 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.yangtools.util;
 
-import com.google.common.annotations.Beta;
 import java.util.Map;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.concepts.Immutable;
@@ -18,7 +17,6 @@ import org.opendaylight.yangtools.concepts.Immutable;
  * @param <K> the type of keys maintained by this map
  * @param <V> the type of mapped values
  */
-@Beta
 public interface UnmodifiableMapPhase<K, V> extends Map<K, V>, Immutable {
     /**
      * Return an isolated modifiable version of this map. Its mappings must match the mappings present in this map. Any