hi all,
I trace a
Java webapp writen by somebody else, and she has a
servlet filter like this:
After read the article (
http://tutorials.jenkov.com/java-servlets/servlet-concurrency.html ), I think that the servlet filter above is not thread-safe.
For example, in the scenario:
t=0,
Thread A set the response member variable
t=1, Thread B set the response member variable
t=2, Thread A pass the response to chain.doFilter()
t=3, Thread B pass the response to chain.doFilter() => bomb!! now thread A and B use the same response instance
But in practical, no customers complain any problem.
My question is,
it's not thread-safe, and have probability to cause problems (rarely maybe), right?