jersey
  1. jersey
  2. JERSEY-1180

ResourceConfig.packages configuration information is lost when using ResourceConfig copy constructor from an ApplicationHandler.getConfiguration()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: 2.0-m05, 2.0
    • Component/s: core
    • Labels:
      None

      Description

      The use-case is to tweak a configuration taken from an ApplicationHandler instance. The following test manifests the issue:

      @Test
      public void testPackageScannerSurvivesCopyingFromFrozenConfig() throws Exception

      { final ResourceConfig originalConfig = new ResourceConfig().packages(DummyTestResource.class.getPackage().getName()); final ResourceConfig copiedFromAppConfig = new ResourceConfig(new ApplicationHandler(originalConfig).getConfiguration()); assertEquals(originalConfig.getClasses(), copiedFromAppConfig.getClasses()); }

      gives:

      expected:<[class org.glassfish.jersey.server.aux.DummyTestResource]> but was:<[]>

      while:

      @Test
      public void testClassConfigSurvivesCopyingFromFrozenConfig() throws Exception

      { final ResourceConfig originalConfig = new ResourceConfig().addClasses(DummyTestResource.class); final ResourceConfig copiedFromAppConfig = new ResourceConfig(new ApplicationHandler(originalConfig).getConfiguration()); assertEquals(originalConfig.getClasses(), copiedFromAppConfig.getClasses()); }

      works just fine

        Activity

        Hide
        Martin Matula added a comment -

        removed copy constructor

        Show
        Martin Matula added a comment - removed copy constructor

          People

          • Assignee:
            Martin Matula
            Reporter:
            Jakub Podlesak
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: