Patch uploaded to address the following multi threading issues:
- SimpleDateFormat.format() throws an exception ArrayIndexOfBounds on multiple threaded access.
- SimpleDateFormat.parse() throws parse exception or returns invalid parsed date
Both these issues are addressed by using a ThreadLocal variable. The attached unit tests first duplicate this issue for the SimpleDateFormat. It then ensures that the ThreadLocal implemenation does not have this issue.
Additionally, an exception in any of the followings lines in ListPathsServlet.doGet() is masked.
final Map<String, String> root = buildRoot(request, doc);
final String path = root.get("path");
final boolean recur = "yes".equals(root.get("recursive"));
final Pattern filter = Pattern.compile(root.get("filter"));
final Pattern exclude = Pattern.compile(root.get("exclude"));
ClientProtocol nnproxy = createNameNodeProxy(ugi);
The doc.endDocument in finally block encounters an exception and masks previous exception. This patch catches and prints the exception before proceeding to finally block.