I want to avoid warnings about raw types, but don't know how to.
import org.apache.lucene.search.Query;
import org.hibernate.search.query.dsl.QueryBuilder;
import org.hibernate.search.query.dsl.BooleanJunction;
final QueryBuilder queryBuilder = ...;
final List<Query> queries = ...;
final BooleanJunction<?> master = queryBuilder.bool();
queries.stream().filter(Objects::nonNull).forEach(master::must);
final Query q = master.createQuery();
It works with BooleanJunction<?>
but I want to replace it with something more understandable.
Going through many websites I found BooleanJunction<BooleanJunction>
which initiates a warning 'BooleanJunction is a raw type. References to generic type BooleanJunction should be parameterized'.
EDIT: forgot to put configuration data
<java.version>1.8</java.version>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->
<version>2.5.3</version>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<hibernate.version>5.5.6.Final</hibernate.version>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-search-orm -->
<hibernate-search-orm.version>5.11.9.Final</hibernate-search-orm.version>