[jbosstools-issues] [JBoss JIRA] (JBIDE-10686) [Validation] Show error when trying to inject unsupported type with @Context

Xavier Coulon (JIRA) jira-events at lists.jboss.org
Tue Feb 28 11:33:36 EST 2012


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

Xavier Coulon updated JBIDE-10686:
----------------------------------

    Attachment: JBIDE-10686.patch


This patch resolve a pretty bad bug: only the first jaxrs method would be validated :-/ Now, the corresponding JAX-RS Resource for a given Eclipse Resource is retrieved, and when it is validated, all its JAX-RS resource methods are validated, too.
                
> [Validation] Show error when trying to inject unsupported type with @Context
> ----------------------------------------------------------------------------
>
>                 Key: JBIDE-10686
>                 URL: https://issues.jboss.org/browse/JBIDE-10686
>             Project: Tools (JBoss Tools)
>          Issue Type: Feature Request
>          Components: Webservices
>    Affects Versions: 3.3.0.M5
>            Reporter: Xavier Coulon
>            Assignee: Xavier Coulon
>            Priority: Minor
>             Fix For: 3.3.0.Beta1
>
>         Attachments: JBIDE-10686.patch
>
>
> The @Context annotation allows to inject instances of javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.UriInfo, javax.ws.rs.core.Request, javax.servlet.HttpServletRequest, javax.servlet.HttpServletResponse, javax.servlet.ServletConfig, javax.servlet.ServletContext, and javax.ws.rs.core.SecurityContext objects.
> If the code is something like that:
> {code}
> 	@POST
> 	public Response save(Content content, @Context UriInfo uri, @Context UriBuilder uriBuilder) {
>          ...
>         }
> {code}
> then the JAX-RS implementation will set 'uriBuilder' not null, which will probably lead to a NullPointerException somewhere in the method code..
> The JAX-RS plugin should report a warning/error to check that the injected type is limited to the list given above. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list