Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
When constructing JAX-RS Providers, we should favor the constructor with the most arguments. For example, in the following, the 4 arg constructor should be selected.
public StringReader(@Context HttpHeaders headers, @Context UriInfo info, @Context Application application, @Context Request request) { super(); this.headers = headers; this.info = info; this.application = application; this.request = request; } public StringReader(@Context HttpHeaders headers, @Context UriInfo info, @Context Application application) { super(); this.headers = headers; this.info = info; this.application = application; } public StringReader(@Context HttpHeaders headers, @Context UriInfo info) { super(); this.headers = headers; this.info = info; } public StringReader(@Context HttpHeaders headers) { super(); this.headers = headers; }
This is tested in the Jakarta EE TCK in test
com/sun/ts/tests/jaxrs/spec/provider/visibility