DOMDataTreeChangeListener.onInitialData() is mandatory 57/96657/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Jun 2021 11:58:11 +0000 (13:58 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Jun 2021 12:23:54 +0000 (14:23 +0200)
Hiding this method is ugly, make sure users are aware of it.

JIRA: MDSAL-674
Change-Id: I9e733b46dea6251b43b3aa97d06e056fd7e8af16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeChangeListener.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/DOMDataTreeListenerTest.java

index a6991110d813bc862ab5954ce33ea3edbb0c44bc..da1f92926549914e5ff2904cc24671d73b02618b 100644 (file)
@@ -44,13 +44,6 @@ public interface DOMDataTreeChangeListener extends EventListener {
      * Invoked only once during registration of the listener if there was no data in the conceptual data tree
      * for the supplied path, which was used to register this listener, and after this
      * {@link #onDataTreeChanged(Collection)} would always be invoked for data changes.
-     *
-     * <p>
-     * Default implementation does nothing and is appropriate for users who do not care about ascertaining
-     * initial stat.
      */
-    // FIXME: 8.0.0: this method should be non-default
-    default void onInitialData() {
-        //no-op
-    }
+    void onInitialData();
 }
index 3d378ca5e3f212eace85006d2a9c3865b70160e1..f23c87022e2ca57f46feb0fdf4a5faca9f0ca7d9 100644 (file)
@@ -418,7 +418,6 @@ public class DOMDataTreeListenerTest extends AbstractDatastoreTest {
     }
 
     static class TestDataTreeListener implements DOMDataTreeChangeListener {
-
         private final List<Collection<DataTreeCandidate>> receivedChanges = new ArrayList<>();
         private final CountDownLatch latch;
 
@@ -432,7 +431,12 @@ public class DOMDataTreeListenerTest extends AbstractDatastoreTest {
             latch.countDown();
         }
 
-        public List<Collection<DataTreeCandidate>> getReceivedChanges() {
+        @Override
+        public void onInitialData() {
+            // noop
+        }
+
+        List<Collection<DataTreeCandidate>> getReceivedChanges() {
             return receivedChanges;
         }
     }