Warning from Jersey due to signature change


#1

I’m building a Jersey-based JAX-RS app. I have a resource with a signature that includes a List where Foo is a class with two properties. See the snippet below:

class SearchFilter(param: String) {
    public val field: String = param.stringBefore('!')
    public val value: String = param.stringAfter('!')
}

class MyResource {
    public fun doSearch(@QueryParam("q") query: String, @QueryParam("filter") filters: List<SearchFilter>): Response {

    }
}

When Jersey loads the above resource, I get the following warning:

WARN [2015-12-02 12:05:06,324] org.glassfish.jersey.internal.Errors: The following warnings have been detected: WARNING: Parameter 2 of type java.util.List<? extends com.seaviewsoftware.runrate.SearchFilter> from public final javax.ws.rs.core.Response com.seaviewsoftware.runrate.RaceResource.doSearch(java.lang.String,java.util.List<? extends com.seaviewsoftware.runrate.SearchFilter>,int,int) is not resolvable to a concrete type.

The kotlin compiler appears to be changing the signature of the method to use a wildcard type, presumably to support kotlin’s Variance feature. Is there a mechanism to turn this off so the signature is concrete?


#3

As a workaround, please use MutableList instead of List. We are working on a nicer way of mitigating this issue


#4

Thanks, using MutableList did the trick. I’m glad to hear that a fix is in the works.

Keep up the good work!