jersey
  1. jersey
  2. JERSEY-1726

Correct signature for TestContainerFactory.support() method

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.17
    • Fix Version/s: 1.18
    • Component/s: test-framework
    • Labels:
      None

      Description

      Curently, the signature of TestContainerFactory.support() method is

      <T extends AppDescriptor> Class<T> supports();

      With such signature users will always have warnings when trying to implement method returning some subclass of AppDescriptor like LowLevelAppDescriptor.class . The reason is that it is impossible to implement the method correctly due to Java generics limitations. Any trial results in "rowtype" or "unchecked" warning.

      The only thing current signature gives is a possibility to call the method like

      TestContainerFactory tcf = ...
      tcf.<LowLevelAppDescriptor>support();

      But this is not necessary, as the method is called only once from JerseyTest.getContainer() method like

      Class<? extends AppDescriptor> adType = tcf.supports();

      I suggest to change the signature to

      Class<? extends AppDescriptor> supports();

      This definitelly will not break anything(maybe, existing clients will need recompilation), and will help me and other users to avoid warnings.

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Pavel Bucek
              Reporter:
              ENargit
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: