A null value in bounce_url is causing the original Request url to be invoked
exactly 20 times, rather than dying with NullPointerException:
public static synchronized void doSomething(
HttpServletRequest request,
HttpServletResponse response,
JspWriter out) {
final String foo = request.getParameter("foo");
String bounce_url = request.getParameter("bounce");
if (DataUtils.isValidFoo(foo)) {
Thread myThread = new Thread(new Runnable() {
public void run() {
FooFactory.foomatic(foo);
}
}, "fooFread");
myThread.start();
}
try {
response.sendRedirect(bounce_url);
} catch (IOException ex) {
logger.log(ex);
}
}
So basically if the "bounce" parameter is not provided then this snippet of
code ends being invoked 20 times. If "bounce" is provided then everything
works fine. Is this a bug in Tomcat?
Java 1.6
Tomcat 6.0.18