interceptors-spec
  1. interceptors-spec
  2. INTERCEPTORS_SPEC-11

Raw type used in InvocationContext.getConstructor() method signature

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2
    • Labels:
      None

      Description

      java.lang.reflect.Constructor is a parameterized type and should not be used in its raw form.

        Activity

        Hide
        Jozef Hartinger added a comment -

        > In which case does it cause compile-time warnings?

        Anytime I try to use the API.

        > Interceptors are not expected to be type specific.

        There won't be any more type information propagated either way. It is really just a question of whether to use an obsolete construct that since Java SE 5 exists for compatibility with legacy code only or not.

        Show
        Jozef Hartinger added a comment - > In which case does it cause compile-time warnings? Anytime I try to use the API. > Interceptors are not expected to be type specific. There won't be any more type information propagated either way. It is really just a question of whether to use an obsolete construct that since Java SE 5 exists for compatibility with legacy code only or not.
        Hide
        marina vatkina added a comment -

        I get no compilation warnings in my test. How do you use it?

        Show
        marina vatkina added a comment - I get no compilation warnings in my test. How do you use it?
        Hide
        Jozef Hartinger added a comment -

        javac -Xlint:all javax/interceptor/InvocationContext.java

        javax/interceptor/InvocationContext.java:115: warning: [rawtypes] found raw type: Constructor
        public Constructor getConstructor();
        ^
        missing type arguments for generic class Constructor<T>
        where T is a type-variable:
        T extends Object declared in class Constructor
        1 warning

        Show
        Jozef Hartinger added a comment - javac -Xlint:all javax/interceptor/InvocationContext.java javax/interceptor/InvocationContext.java:115: warning: [rawtypes] found raw type: Constructor public Constructor getConstructor(); ^ missing type arguments for generic class Constructor<T> where T is a type-variable: T extends Object declared in class Constructor 1 warning
        Hide
        marina vatkina added a comment -

        Interestingly mvn even with the -Xlint:all in the <compilerArgument> of its maven-compiler-plugin doesn't complain. I need to understand the MR update rules to make any changes after the submission.

        Show
        marina vatkina added a comment - Interestingly mvn even with the -Xlint:all in the <compilerArgument> of its maven-compiler-plugin doesn't complain. I need to understand the MR update rules to make any changes after the submission.
        Hide
        marina vatkina added a comment -

        Fixed in javax.interceptor-api-1.2-b05

        Show
        marina vatkina added a comment - Fixed in javax.interceptor-api-1.2-b05

          People

          • Assignee:
            marina vatkina
            Reporter:
            Jozef Hartinger
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: