[jbosstools-issues] [JBoss JIRA] (JBIDE-18714) Invalid error message when @Target is missing on a custom Name Binding annotation

Xavier Coulon (JIRA) issues at jboss.org
Wed Oct 29 08:03:35 EDT 2014


     [ https://issues.jboss.org/browse/JBIDE-18714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Coulon updated JBIDE-18714:
----------------------------------
    Description: 
With the following code:
{code}
@NameBinding
@Retention(RetentionPolicy.RUNTIME)
public @interface LoggingBinding {

}
{code}

The error message is
{quote}
The Name Binding should have a @Target(ElementType.METHOD) annotation on its type.
{quote}
but it should be 
{quote}
The Name Binding should have a @Target(\{ElementType.TYPE, ElementType.METHOD\}) annotation on its type.
{quote}

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


  was:
With the following code:
{code}
@NameBinding
@Retention(RetentionPolicy.RUNTIME)
public @interface LoggingBinding {

}
{code}

The error message is
{quote}
The Name Binding should have a @Target(ElementType.METHOD) annotation on its type.
{quote}
but it should be 
{quote}
The Name Binding should have a @Target({ElementType.TYPE, ElementType.METHOD}) annotation on its type.
{quote}

Note that the QuickFix adds the correct {{@Target({ElementType.TYPE, ElementType.METHOD})}}, but the error message was misleading




> Invalid error message when @Target is missing on a custom Name Binding annotation
> ---------------------------------------------------------------------------------
>
>                 Key: JBIDE-18714
>                 URL: https://issues.jboss.org/browse/JBIDE-18714
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: webservices
>    Affects Versions: 4.2.0.Final
>            Reporter: Xavier Coulon
>            Assignee: Xavier Coulon
>             Fix For: 4.2.1.Final, 4.3.0.Alpha1
>
>
> With the following code:
> {code}
> @NameBinding
> @Retention(RetentionPolicy.RUNTIME)
> public @interface LoggingBinding {
> }
> {code}
> The error message is
> {quote}
> The Name Binding should have a @Target(ElementType.METHOD) annotation on its type.
> {quote}
> but it should be 
> {quote}
> The Name Binding should have a @Target(\{ElementType.TYPE, ElementType.METHOD\}) annotation on its type.
> {quote}
> Note that the QuickFix adds the correct {{@Target(\{ElementType.TYPE, ElementType.METHOD\})}}, it's just that the initial error message was misleading



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jbosstools-issues mailing list