Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-2994

JAX-RS Provider construction favors constructor with the most args

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 8.0.7, 8.0.8
    • TomEE Core Server
    • 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

      Attachments

        Activity

          People

            dblevins David Blevins
            dblevins David Blevins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: