Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.1
    • Fix Version/s: 7.0.2
    • Component/s: doc
    • Labels:
      None

      Description

      Examples to the use of @Resource are wrong.
      Example, 6.5.3.1:

      @Resources ({
          @Resource(name="myDB" type=javax.sql.DataSource),
          @Resource(name="myMQ" type=javax.jms.ConnectionFactory)
      })
      

      Just to be syntactically correct, the type value either has to be between double quotes, or .class needs to be appended to return the actual Class object. As per the specification, type is defined as "public abstract Class<?> type". Correction of above would look like:

      @Resources ({
          @Resource(name="myDB" type=javax.sql.DataSource.class),
          @Resource(name="myMQ" type=javax.jms.ConnectionFactory.class)
      })
      

      I would suggest to extend this case by means of a regex search through the documentation.

        Activity

        Hide
        Ian Evans added a comment -

        Fixed in source. I did a grep through the documentation, and this was the only instance of a class-level @Resource with a type attribute.

        Show
        Ian Evans added a comment - Fixed in source. I did a grep through the documentation, and this was the only instance of a class-level @Resource with a type attribute.

          People

          • Assignee:
            Ian Evans
            Reporter:
            jd3714att
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: