Tuscany
  1. Tuscany
  2. TUSCANY-2140

@Scope annotation on interface does not give an error

    Details

    • Patch Info:
      Patch Available

      Description

      Java Common Annotations and APIs spec - section 1.8.6 (lines 1592 thru 1602) shows an example of specifying @Scope annotation on an interface definition. I am noticing that this annotation is ignored and only the Scope set on the implementation class is used.

      This is as per the spec (corrected in the errata), but then @Scope on an interface should result in an error, which does not seem to happen!!

      1. TUSCANY-2140.patch
        6 kB
        Vamsavardhana Reddy

        Activity

        Hide
        ant elder added a comment -

        I've tried applying this patch but then i get lots of build fails in other modules.

        Show
        ant elder added a comment - I've tried applying this patch but then i get lots of build fails in other modules.
        Hide
        Vamsavardhana Reddy added a comment -

        Unassigned so that a committer can pickup.

        Show
        Vamsavardhana Reddy added a comment - Unassigned so that a committer can pickup.
        Hide
        Vamsavardhana Reddy added a comment -

        TUSCANY-2140.patch: Adds a JUnitTest and a fix. I have created a new exception class IllegalAnnotationException extending InvalidInterfaceException. If someone has a better name for this exception class, we can use that.

        Show
        Vamsavardhana Reddy added a comment - TUSCANY-2140 .patch: Adds a JUnitTest and a fix. I have created a new exception class IllegalAnnotationException extending InvalidInterfaceException. If someone has a better name for this exception class, we can use that.
        Hide
        Vamsavardhana Reddy added a comment -

        Errata says
        ------------
        7. @Scope annotations may only be used on classes, not interfaces.

        Replace the sentence on lines 1584-1585 with the following: "The @Scope annotation type is may only be used on a service's implementation class. It is an error to use this annotation on an interface."

        Delete the example in lines 1592-1603.
        -------------------
        So, it should give an error when @Scope is used on an interface, which I don't recall observing. Will verify and change the description accordingly.

        Show
        Vamsavardhana Reddy added a comment - Errata says ------------ 7. @Scope annotations may only be used on classes, not interfaces. Replace the sentence on lines 1584-1585 with the following: "The @Scope annotation type is may only be used on a service's implementation class. It is an error to use this annotation on an interface." Delete the example in lines 1592-1603. ------------------- So, it should give an error when @Scope is used on an interface, which I don't recall observing. Will verify and change the description accordingly.

          People

          • Assignee:
            Unassigned
            Reporter:
            Vamsavardhana Reddy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development