From 7697132beb48f97c2261091cac141a8554faac26 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 27 Sep 2021 15:46:34 +0200 Subject: [PATCH] Deprecate util.Immutables for removal This class is rather incompete in its mission and it is not used anywhere. Deprecate it for removal. JIRA: YANGTOOLS-1330 Change-Id: I54ad2666e1b7660e5d93d90ff924de1e640df754 Signed-off-by: Robert Varga (cherry picked from commit 1dc00960a5ccc7434d06688f1140e59ca010192c) --- .../org/opendaylight/yangtools/util/Immutables.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java b/common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java index f8639de7f8..ebf4136abe 100644 --- a/common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java +++ b/common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java @@ -15,6 +15,7 @@ import java.math.BigInteger; import org.opendaylight.yangtools.concepts.Immutable; import org.opendaylight.yangtools.concepts.Mutable; +@Deprecated(since = "7.0.9", forRemoval = true) public final class Immutables { private static final ImmutableSet> KNOWN_IMMUTABLES = ImmutableSet.of( Integer.class, Short.class, BigDecimal.class, BigInteger.class, Byte.class, Character.class, Double.class, @@ -30,19 +31,14 @@ public final class Immutables { *

Note: This method may return false to immutable objects which * immutability is not known, was defined not using concepts term. * - * @param obj - * Reference to check + * @param obj Reference to check * @return true if object is known to be immutable false otherwise. */ public static boolean isImmutable(final Object obj) { checkArgument(obj != null,"Object should not be null"); if (obj instanceof Mutable) { return false; - } else if (obj instanceof Immutable) { - return true; - } else if (obj instanceof String) { - return true; - } else if (KNOWN_IMMUTABLES.contains(obj.getClass())) { + } else if (obj instanceof Immutable || obj instanceof String || KNOWN_IMMUTABLES.contains(obj.getClass())) { return true; } return false; -- 2.36.6