Source:
<code>public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Handler singleContext = _singleContext; if (singleContext != null) { singleContext.handle(target, baseRequest, request, response); return; } Mapping mapping = (Mapping)_handlers.get(); <START> if (mapping == null && mapping.getHandlers().length == 0) <END> return; HttpChannelState async = baseRequest.getHttpChannelState(); if (async.isAsync()) { ContextHandler context = async.getContextHandler(); if (context != null) { Handler branch = mapping._contextBranches.get(context); if (branch == null) context.handle(target, baseRequest, request, response); else branch.handle(target, baseRequest, request, response); return; } } if (target.startsWith("/")) { Trie<Map.Entry<String, Branch[]>> pathBranches = mapping._pathBranches; if (pathBranches == null) return; int limit = target.length() - 1; while (limit >= 0) { Map.Entry<String, Branch[]> branches = pathBranches.getBest(target, 1, limit); if (branches == null) break; int l = branches.getKey().length(); if (l == 1 || target.length() == l || target.charAt(l) == '/') { for (Branch branch : branches.getValue()) { branch.getHandler().handle(target, baseRequest, request, response); if (baseRequest.isHandled()) return; } } limit = l - 2; } } else { if (mapping.getHandlers() == null) return; for (int i = 0; i < mapping.getHandlers().length; i++) { mapping.getHandlers()[i].handle(target, baseRequest, request, response); if (baseRequest.isHandled()) return; } } }</code><technical_language>This throw NPE if mapping is null. I suppose meant: if (mapping == null || mapping.getHandlers().length == 0) return;</technical_language>

Target:
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Mapping mapping = (Mapping)_handlers.get(); if (mapping == null) return; Handler[] handlers = mapping.getHandlers(); if (handlers == null || handlers.length == 0) return; if (handlers.length == 1) { handlers[0].handle(target, baseRequest, request, response); return; } HttpChannelState async = baseRequest.getHttpChannelState(); if (async.isAsync()) { ContextHandler context = async.getContextHandler(); if (context != null) { Handler branch = mapping._contextBranches.get(context); if (branch == null) context.handle(target, baseRequest, request, response); else branch.handle(target, baseRequest, request, response); return; } } if (target.startsWith("/")) { Trie<Map.Entry<String, Branch[]>> pathBranches = mapping._pathBranches; if (pathBranches == null) return; int limit = target.length() - 1; while (limit >= 0) { Map.Entry<String, Branch[]> branches = pathBranches.getBest(target, 1, limit); if (branches == null) break; int l = branches.getKey().length(); if (l == 1 || target.length() == l || target.charAt(l) == '/') { for (Branch branch : branches.getValue()) { branch.getHandler().handle(target, baseRequest, request, response); if (baseRequest.isHandled()) return; } } limit = l - 2; } } else { for (Handler handler : handlers) { handler.handle(target, baseRequest, request, response); if (baseRequest.isHandled()) return; } } }