Deprecate IllegalArgumentCodec for removal 55/97655/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Sep 2021 15:11:40 +0000 (17:11 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 27 Sep 2021 15:13:05 +0000 (17:13 +0200)
As previously noted, this interface encourages bad patterns. All
downstream users are better served with their domain-specific
interfaces. Deprecate it with the intent to remove.

JIRA: YANGTOOLS-1334
Change-Id: If0e56b2ff575d101dbd090112f22e80565e5e6bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/AbstractIllegalArgumentCodec.java
common/concepts/src/main/java/org/opendaylight/yangtools/concepts/IllegalArgumentCodec.java
common/concepts/src/test/java/org/opendaylight/yangtools/concepts/AbstractIllegalArgumentCodecTest.java

index 6be4f95a372f3bb076eee6541f84f5beb07a0939..011a921f72b07d5e6dee6d807598111416e73dc8 100644 (file)
@@ -19,8 +19,11 @@ import org.eclipse.jdt.annotation.Nullable;
  *
  * @param <S> Serializied (external) type
  * @param <D> Deserialized (internal) type
+ * @deprecated This is a base class for implementing IllegalArgumentCodec, without further use. It will be removed with
+ *             IllegalArgumentCodec.
  */
 @Beta
+@Deprecated(since = "8.0.0", forRemoval = true)
 public abstract class AbstractIllegalArgumentCodec<S, D> implements IllegalArgumentCodec<S, D> {
     @Override
     public final D deserialize(final S input) {
index 87b69b936b7cc1d117224e7ba29a078e584f83b9..dcbd6b0a6b462764e250594e14c33310288d6f54 100644 (file)
@@ -16,8 +16,14 @@ import org.eclipse.jdt.annotation.NonNull;
  *
  * @param <S> Serialized (external) type
  * @param <D> Deserialized (internal) type
+ * @deprecated This interface ignores a number of complications when dealing with external forms. For one, it assumes
+ *             a serdes operation does not have further context than the input -- and this is seldom the case. The other
+ *             failing is that it actively discourages use of checked exceptions to deal with errors at the appropriate
+ *             level. Based on these, this interface is deprecated for removal without a replacement. Users are
+ *             encouraged to define similar interface fitting their needs.
  */
 @Beta
+@Deprecated(since = "8.0.0", forRemoval = true)
 public interface IllegalArgumentCodec<S, D> {
     /**
      * Produce an internal object based on an external object.
index fe11a9b4843fa3487ef0d752ea85a49c7e7e65de..b645e3051c44fa6ce747ed3940c527bd0a07b537 100644 (file)
@@ -11,6 +11,7 @@ import static org.junit.Assert.assertThrows;
 
 import org.junit.Test;
 
+@Deprecated(since = "8.0.0", forRemoval = true)
 public class AbstractIllegalArgumentCodecTest {
     private static final class TestCodec extends AbstractIllegalArgumentCodec<String, String> {
         @Override