javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2552

ResourceDependencyScanner breaks component extensibilty

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Incomplete
    • Affects Version/s: 2.0.8, 2.0.9, 2.1.12, 2.1.13
    • Fix Version/s: None
    • Labels:
      None
    • Status Whiteboard:
      Hide

      Downgrade to minor since a workaround is available. Still working on it, though!

      Show
      Downgrade to minor since a workaround is available. Still working on it, though!

      Description

      The mojarra implementation of @ResourceDependencies and @ResourceDependency scanner makes @ResourceDependency take precedence over @ResourceDependencies.
      It breaks the possibility to extends component and renderer.

      When a super class of a renderer/component is annotated with @ResourceDependency, this annotation is taken even if we annotate an extending class with @resourceDependencies. If the extending class is annotated with @ResourceDependency, behavior is the expected.

      I create a case wich reproduced the issue (maven project zipped in attachement).
      There are 3 components and 3 renderers packaged in a jar. A simple page is packaged with this jar in a war.

      Each component extends javax.faces.component.UIComponentBase and has its own renderer.
      There are RedPanelRenderer wich extends javax.faces.render.Renderer, GreenPanelRenderer and BluePanelRenderer wich extend RedPanelRenderer.

      RedPanelRenderer and BluePanelRenderer are annotated with @ResourceDependency and behavior is the expected.
      GreenPanelRenderer is annotated with @ResourceDependencies and at runtime, CSS file in resource dependencies is not loaded. @ResourceDependency of RedPanelRenderer is instead.

      I suggest a patch in attachment. It resolves this issue:

      Scanner try for each component/renderer to get the @resourcesDependency AND the @ResourceDependencies. (Before it tried to get the @resourcesDependency and if not exists the @ResourceDependencies)
      As these annotations are @Inherited this is the only way to work as expected.
      Now @resourcesDependencies takes the precedence over @RessourceDependency and @resourceDependency is always loaded even if a @resourceDependencies is present and loaded.

      I think it's the better solution...

        Activity

        Hide
        Ed Burns added a comment -

        Maybe the real problem is the @Inherited. Does this issue must be a spec issue?

        Yes, that may be the real problem. I'm investigating. If necessary, I'll file the spec issue.

        Show
        Ed Burns added a comment - Maybe the real problem is the @Inherited. Does this issue must be a spec issue? Yes, that may be the real problem. I'm investigating. If necessary, I'll file the spec issue.
        Hide
        Ed Burns added a comment -

        I have decided to proceed with removing @Inherited on @ResourceDependency and @ResourceDependencies. Would you be so kind as to try removing it on your end and see if it solves your problem? If not, can you suggest a patch to account for the change in removing @Inherited on those annotations?

        Ed

        Show
        Ed Burns added a comment - I have decided to proceed with removing @Inherited on @ResourceDependency and @ResourceDependencies. Would you be so kind as to try removing it on your end and see if it solves your problem? If not, can you suggest a patch to account for the change in removing @Inherited on those annotations? Ed
        Hide
        Manfred Riem added a comment -

        Lowering priority because of no response

        Show
        Manfred Riem added a comment - Lowering priority because of no response
        Hide
        Manfred Riem added a comment -

        Lowering priority because of no response

        Show
        Manfred Riem added a comment - Lowering priority because of no response
        Hide
        Manfred Riem added a comment -

        Closing because of inactivity

        Show
        Manfred Riem added a comment - Closing because of inactivity

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexandre Lewandowski
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: