Tapestry
  1. Tapestry
  2. TAPESTRY-2481

ClassTransformation acts as if all type-level annotations are inherited; it should filter out non-inherited annotations

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.13
    • Fix Version/s: 5.0.14
    • Component/s: Annotations
    • Labels:
      None
    • Environment:
      Linux, JDK 1.5, Jetty 6.1.9

      Description

      I have a class that includes a stylesheet via IncludeStylesheet annotation.

      The problem occurs when I subclass this class from a different package than the stylesheet's package. The annotation is inherited, but the subclass can't locate the relative path to the CSS.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        21h 19m 1 Howard M. Lewis Ship 26/Jun/08 17:27
        In Progress In Progress Closed Closed
        55m 22s 1 Howard M. Lewis Ship 26/Jun/08 18:22
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12568744 ] jira [ 12590115 ]
        Mark Thomas made changes -
        Workflow jira [ 12434058 ] Default workflow, editable Closed status [ 12568744 ]
        Hide
        Fernando Padilla added a comment -

        wait. So what's the expected behavior now. Will my expectations still work:

        I write a component using the InjectStylesheet annotation.
        I extend that component and expect the previous stylesheets to still be brought in.

        • or do i have to figure out all previous stylesheets some how and maintain them still?
        Show
        Fernando Padilla added a comment - wait. So what's the expected behavior now. Will my expectations still work: I write a component using the InjectStylesheet annotation. I extend that component and expect the previous stylesheets to still be brought in. or do i have to figure out all previous stylesheets some how and maintain them still?
        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.0.14 [ 12313214 ]
        Resolution Fixed [ 1 ]
        Howard M. Lewis Ship made changes -
        Summary Superclass that includes a stylesheet via IncludeStylesheet annotation breaks any subclass not in the same package as the stylesheet. ClassTransformation acts as if all type-level annotations are inherited; it should filter out non-inherited annotations
        Affects Version/s 5.0.11 [ 12312968 ]
        Affects Version/s 5.0.13 [ 12313205 ]
        Hide
        Howard M. Lewis Ship added a comment -

        The code inside ClassTransformation.getAnnotation() collects together all annotations from the current class, plus all annotations on base classes, whether or not they have the @Inherit annotation.

        Show
        Howard M. Lewis Ship added a comment - The code inside ClassTransformation.getAnnotation() collects together all annotations from the current class, plus all annotations on base classes, whether or not they have the @Inherit annotation.
        Hide
        Howard M. Lewis Ship added a comment -

        Checking the code for AssetInjectionProvider and IncludeStylesheetWorker I can see that the code is doing the correct thing; the code is smart enough to use the resources of the component with the annotation (i.e., the base class's Resource, from it's ComponentModel) rather than the sub-class' Resource.

        I built at quick test case (using @Inject for an asset, since that's easier to test).

        @InjectStylesheet is not inherited by base classes ... oh wait, logic inside ClassTransformation is making all annotations effectively inherited. I wonder why?

        Show
        Howard M. Lewis Ship added a comment - Checking the code for AssetInjectionProvider and IncludeStylesheetWorker I can see that the code is doing the correct thing; the code is smart enough to use the resources of the component with the annotation (i.e., the base class's Resource, from it's ComponentModel) rather than the sub-class' Resource. I built at quick test case (using @Inject for an asset, since that's easier to test). @InjectStylesheet is not inherited by base classes ... oh wait, logic inside ClassTransformation is making all annotations effectively inherited. I wonder why?
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Field Original Value New Value
        Assignee Howard M. Lewis Ship [ hlship ]
        Hide
        Howard M. Lewis Ship added a comment -

        This raises another issue; if the "asset:" binding prefix is used in a super-class template, it should be relative to the super-class, not the extending class.

        Show
        Howard M. Lewis Ship added a comment - This raises another issue; if the "asset:" binding prefix is used in a super-class template, it should be relative to the super-class, not the extending class.
        Andrew created issue -

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Andrew
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development