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

        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.
        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?
        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
        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?

          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