Fix StmtContext.get{Original,PreviousCopy}Ctx() return type
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / StmtContext.java
index ce8e1996e255199f31af8c3cb29d99e469356dd8..59a08809ad30fd85b2cb56d6cb9ad34d62b8d936 100644 (file)
@@ -203,7 +203,7 @@ public interface StmtContext<A, D extends DeclaredStatement<A>, E extends Effect
      *
      * @return Original definition, if this statement was copied.
      */
-    Optional<StmtContext<?, ?, ?>> getOriginalCtx();
+    Optional<StmtContext<A, D, E>> getOriginalCtx();
 
     /**
      * Return the context of the previous copy of this statement -- effectively walking towards the source origin
@@ -211,7 +211,7 @@ public interface StmtContext<A, D extends DeclaredStatement<A>, E extends Effect
      *
      * @return Context of the previous copy of this statement, if this statement has been copied.
      */
-    Optional<? extends StmtContext<?, ?, ?>> getPreviousCopyCtx();
+    Optional<StmtContext<A, D, E>> getPreviousCopyCtx();
 
     ModelProcessingPhase getCompletedPhase();
 
@@ -290,8 +290,18 @@ public interface StmtContext<A, D extends DeclaredStatement<A>, E extends Effect
             return childCopyOf(stmt, type, null);
         }
 
+        @Override
+        default Collection<? extends StmtContext<?, ?, ?>> declaredSubstatements() {
+            return mutableDeclaredSubstatements();
+        }
+
         @NonNull Collection<? extends Mutable<?, ?, ?>> mutableDeclaredSubstatements();
 
+        @Override
+        default Collection<? extends StmtContext<?, ?, ?>> effectiveSubstatements() {
+            return mutableEffectiveSubstatements();
+        }
+
         @NonNull Collection<? extends Mutable<?, ?, ?>> mutableEffectiveSubstatements();
 
         /**