Do not call setFullyDefined() in ReplicateStatementContext 10/94810/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 26 Jan 2021 10:51:54 +0000 (11:51 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 26 Jan 2021 10:54:31 +0000 (11:54 +0100)
When we are copying statements the source needs to have its effective
model present, hence it needs to be fullyDefined() already.

That makes it a 'true -> true' transition, which we do not need.
Verify that source.fullyDefined() and skip the set operation.

Change-Id: Iff21df88f6c5d35c05e4a165953ee1de586d9c4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ReplicaStatementContext.java

index eaa39de25ea6a6a47e276f9a1e3c2aeaf0d816ce..c5c7d3862a41638657956bc0966f891b29d10c52 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.reactor;
 
+import static com.google.common.base.Verify.verify;
 import static java.util.Objects.requireNonNull;
 
 import java.util.Collection;
@@ -40,9 +41,8 @@ final class ReplicaStatementContext<A, D extends DeclaredStatement<A>, E extends
         this.parent = requireNonNull(parent);
         this.source = requireNonNull(source);
         if (source.isSupportedToBuildEffective()) {
+            verify(source.fullyDefined(), "Source %s is not fully defined", source);
             source.incRef();
-            // FIXME: is this call really needed? it is inherited from source
-            setFullyDefined();
         }
     }