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

JAX-RS Provider construction favors constructor with the most args

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment Visibility
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.0.7, 8.0.8
    • Component/s: TomEE Core Server
    • Labels:
      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

            • Assignee:
              dblevins David Blevins
              Reporter:
              dblevins David Blevins

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment