* @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());
}
* @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));
}
}