Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-15825

JAX-RS problems don't show up after target runtime is set

    Details

    • Steps to Reproduce:
      Hide

      STEP: Create Dynamic Web Project with Target runtime: <None>
      STEP: Activate JAX-RS support

      Create code that would cause errors if a target runtime was set
      (e.g. create HttpMethod annotation without Target and Retention annotations; or create JAX-RS Activator without specifing ApplicationPath; or create more JAX-RS Activators in one project) and then set target runtime.

      STEP: Create annotation annotated with the @HttpMethod annotation without @Target and @Retention annotations.

      MyAnnotation.java
      import javax.ws.rs.HttpMethod;
      
      @HttpMethod(value="GET")
      public @interface MyAnnotation {
       
      }
      

      ASSERT: There are 3 errors (related to no target runtime):
      -HttpMethod cannot be resolved to a type
      -The attribute value is undefined for the annotation type HttpMethod
      -The import javax.ws cannot be resolved

      STEP: Set Target runtime (Select project, open its Properties, Targeted Runtimes, check runtime e.g. EAP 6.1)
      STEP: There are 2 errors (related to problems in code):
      -The HTTP Method should have a @Retention(RetentionPolicy.RUNTIME) annotation on its type.
      -The HTTP Method should have a @Target(ElementType.METHOD) annotation on its type.

      FAIL: There is no error.

      Show
      STEP: Create Dynamic Web Project with Target runtime: <None> STEP: Activate JAX-RS support Create code that would cause errors if a target runtime was set (e.g. create HttpMethod annotation without Target and Retention annotations; or create JAX-RS Activator without specifing ApplicationPath; or create more JAX-RS Activators in one project) and then set target runtime. STEP: Create annotation annotated with the @HttpMethod annotation without @Target and @Retention annotations. MyAnnotation.java import javax.ws.rs.HttpMethod; @HttpMethod(value= "GET" ) public @ interface MyAnnotation { } ASSERT: There are 3 errors (related to no target runtime): -HttpMethod cannot be resolved to a type -The attribute value is undefined for the annotation type HttpMethod -The import javax.ws cannot be resolved STEP: Set Target runtime (Select project, open its Properties, Targeted Runtimes, check runtime e.g. EAP 6.1) STEP: There are 2 errors (related to problems in code): -The HTTP Method should have a @Retention(RetentionPolicy.RUNTIME) annotation on its type. -The HTTP Method should have a @Target(ElementType.METHOD) annotation on its type. FAIL: There is no error.

      Description

      JAX-RS problems don't show up after target runtime is set on project that was created with target runtime set to <None>.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                xcoulon Xavier Coulon
                Reporter:
                rrabara Radoslav RĂ¡bara
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: