eclipse-ee4j / eclipse-ee4j/jersey
NullPointerException when SecurityEntityFilteringFeature enabled
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I enabled SecurityEntityFilteringFeature. When I test a 406 due to a not supported media-type I get a NullPointerException thrown by ServerScopeProvider.getFilteringScopes because the getMatchedMethods() returns a null
```
for (final ResourceMethod method : ServerScopeProvider.getMatchedMethods(uriInfo)) {
final Invocable invocable = method.getInvocable();
mergeFilteringScopes(filteringScope,
getFilteringScopes(invocable.getHandlingMethod(), invocable.getHandler().getHandlerClass()));
if (!filteringScope.isEmpty()) {
uriToContexts.putIfAbsent(path, filteringScope);
return filteringScope;
}
}
```
How can I tell Jersey to execute this feature only if I return a 200
#### Affected Versions
[2.17]
Contributor guide
Research direction
Start in ServerScopeProvider.getFilteringScopes and inspect how getMatchedMethods() is handled when a 406 unsupported-media-type response occurs with SecurityEntityFilteringFeature enabled. Reproduce the reported NullPointerException and verify that filtering is only executed for a successful 200 response without breaking other response handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100