Use record for test value 11/100511/5
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 9 Apr 2022 22:22:36 +0000 (00:22 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 25 Apr 2022 12:08:38 +0000 (12:08 +0000)
We can simplify the implementation here with JDK17.

Change-Id: I16e8900f59eaba17aaf4cb36da949d73bfeb43f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
data/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueAttrNodeTest.java

index 73734bdaf8bb8021da3977bc1046f176c83b11cb..92b4ae43cb38266b7c5e63972028d974ea28d09e 100644 (file)
@@ -16,23 +16,8 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 
 public class AbstractImmutableNormalizedValueAttrNodeTest {
-    // FIXME: Record once we have JDK17
-    private static final class TestValue {
-        private final int value;
-
-        TestValue(final int value) {
-            this.value = value;
-        }
-
-        @Override
-        public int hashCode() {
-            return value;
-        }
-
-        @Override
-        public boolean equals(final Object obj) {
-            return obj == this || obj instanceof TestValue && value == ((TestValue) obj).value;
-        }
+    private record TestValue(int value) {
+        // Simple enough
     }
 
     private static final QName ROOT_QNAME = QName.create("urn:test", "2014-03-13", "root");