Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Engine 2.7.4
-
None
Description
Right now, calling FilterChain.doFilter twice will trigger an ArrayIndexOutOfBoundException (timer array based on the number of registered filter handles).
Such (bad) code can trigger this:
...
filterChain.doFilter(...)
...
if (wrongAssumption()) {
filterChain.doFilter(...);
}
...
it's not obvious for the developer from the ArrayIndexOutOfBoundException what he did wrong and i think we should
1. either throw a servlet exception saying "Filter should not been called twice", either log a warning with the stack trace
2. document clearly in sling filters that filter should not be called twice, referring to both case (ArrayIndexOufOfBoundException and whatever comes out of 1.)
Attachments
Issue Links
- duplicates
-
SLING-9925 ArrayIndexOutOfBoundsException in AbstractSlingFilterChain
- Resolved