jersey
  1. jersey
  2. JERSEY-722

handling of @PostConstruct/@PreDestroy does not support class hierarchies with such methods

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: None
    • Labels:
      None

      Description

      @PostConstruct methods on an object of type T should be called from @PostConstruct on Object.class to @PostConstruct on T.class, that is if both some class and its superclass have a method annotated with @PostConstruct, then the method from the superclass should be called first, and then the method from "some" class should be called.

      @PreDestroy methods on an object of type T should be called from @PreDestroy on T.class to @PreDestroy on Object.class.

      The current code in the com.sun.jersey.core.spi.component.ComponentConstructor and com.sun.jersey.core.spi.component.ComponentDestructor will only invoke a single arbitrary @PostConstruct/@PreDestory method, even when a class and its superclasses all have a methods with @PostConstruct/@PreDestroy annotation.

        Activity

        Hide
        Martin Matula added a comment -

        Fixed in rev. 4963.

        Show
        Martin Matula added a comment - Fixed in rev. 4963.

          People

          • Assignee:
            Martin Matula
            Reporter:
            Oleg Estekhin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: