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

Invalid error message when @Target is missing on a custom Name Binding annotation

XMLWordPrintable

      With the following code:

      @NameBinding
      @Retention(RetentionPolicy.RUNTIME)
      public @interface LoggingBinding {
      
      }
      

      The error message is

      The Name Binding should have a @Target(ElementType.METHOD) annotation on its type.

      but it should be

      The Name Binding should have a @Target({ElementType.TYPE, ElementType.METHOD}) annotation on its type.

      Note that the QuickFix adds the correct @Target({ElementType.TYPE, ElementType.METHOD}), it's just that the initial error message was misleading

            xcoulon@redhat.com Xavier Coulon
            xcoulon@redhat.com Xavier Coulon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: