Skip to content

Commit

Permalink
Remove unnecessary setter causing NPEs
Browse files Browse the repository at this point in the history
The HttpServletRequest is provided by CDI per default. The removed
code was a rest overseen while fixing the CDI TCK problems. Anyway,
testsuite and TCK are working without this code, so it can be removed
completely.
  • Loading branch information
erdlet committed Jul 29, 2022
1 parent f91d187 commit e09d996
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public class JaxRsContextProducer {

private Configuration configuration;

private HttpServletRequest request;

private HttpServletResponse response;

private Application application;
Expand Down Expand Up @@ -87,11 +85,6 @@ protected void setConfiguration(Configuration configuration) {
this.configuration = Objects.requireNonNull(configuration, "Configuration must not be null");
}

// using 'package private' here seems to break the CDI scope for some reason
protected void setRequest(HttpServletRequest request) {
this.request = Objects.requireNonNull(request, "Request must not be null");
}

// using 'package private' here seems to break the CDI scope for some reason
protected void setResponse(HttpServletResponse response) {
this.response = Objects.requireNonNull(response, "Response must not be null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public class PostMatchingRequestFilter implements ContainerRequestFilter {
@Context
private Configuration configuration;

@Inject
private HttpServletRequest request;

@Context
private HttpServletResponse response;

Expand All @@ -66,7 +63,6 @@ public void filter(ContainerRequestContext requestContext) {

// store JAX-RS context objects so we can produce them via CDI
contextProducer.setConfiguration(configuration);
contextProducer.setRequest(request);
contextProducer.setResponse(response);
contextProducer.setApplication(application);
contextProducer.setUriInfo(uriInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public void filter(ContainerRequestContext requestContext) {

// store JAX-RS context objects so we can produce them via CDI
contextProducer.setConfiguration(configuration);
contextProducer.setRequest(request);
contextProducer.setResponse(response);
contextProducer.setApplication(application);
contextProducer.setUriInfo(uriInfo);
Expand Down

0 comments on commit e09d996

Please sign in to comment.