Fix StmtContext.produces{Declared,Effective} signatures
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / StmtContextDefaults.java
index 59fb76f71c4b5ac85db5b6b62ef3be62bcdf4efb..0dbf3fee275813ed0d97be3c939f189bf9f9114d 100644 (file)
@@ -29,11 +29,11 @@ public final class StmtContextDefaults {
      * @param type Effective statement representation being look up
      * @return Effective statement argument, if found
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
+    @SuppressWarnings("unchecked")
     public static <A, E extends EffectiveStatement<A, ?>> @NonNull Optional<A> findSubstatementArgument(
             final @NonNull StmtContext<?, ?, ?> stmt, final @NonNull Class<E> type) {
         return stmt.allSubstatementsStream()
-                .filter(ctx -> ctx.isSupportedToBuildEffective() && ((StmtContext) ctx).producesEffective(type))
+                .filter(ctx -> ctx.isSupportedToBuildEffective() && ctx.producesEffective(type))
                 .findAny()
                 .map(ctx -> (A) ctx.coerceStatementArgument());
     }
@@ -45,10 +45,9 @@ public final class StmtContextDefaults {
      * @param type Effective statement representation being look up
      * @return True if a match is found, false otherwise
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
     public static boolean hasSubstatement(final @NonNull StmtContext<?, ?, ?> stmt,
             final @NonNull Class<? extends EffectiveStatement<?, ?>> type) {
         return stmt.allSubstatementsStream()
-            .anyMatch(ctx -> ctx.isSupportedToBuildEffective() && ((StmtContext) ctx).producesEffective(type));
+            .anyMatch(ctx -> ctx.isSupportedToBuildEffective() && ctx.producesEffective(type));
     }
 }