Description
Since SIS 1.1, Filters and expressions in org.apache.sis.filter package have methods with a signature like below. This signature reproduced the state of GeoAPI 3.1 draft (not yet released).
List<Expression<? super R, ?>> getParameters();
However experience has shown that contravariance (the <? super> part) cause difficulties that are hard to resolve. The problem is that filters are often chained. When a code follows a chain of filters, it may need to check for parameters of parameters. In such cases, invoking the above getParameters() method, then invoking again getParameters() on the result, gives a type that looks like <? super ? super R>>, which is identified by the Java compiler as {{<? super #CAP1>. The consequence is many compilation errors of the kind "no method match List<Expression<? super #CAP1, ?>> which are hard to resolve otherwise than by unsafe cast. Consequently, for having more type-safe code, it seems necessary to change above method signature like below:
List<Expression<R, ?>> getParameters();