Merge pull request #2674 from mperktold/jetty-9.4.x
Eliminated redundant invocations of HandlerCollection.getHandlers()
This commit is contained in:
commit
5e1db95282
|
@ -85,7 +85,8 @@ public class ContextHandlerCollection extends HandlerCollection
|
|||
{
|
||||
_contextBranches.clear();
|
||||
|
||||
if (getHandlers()==null)
|
||||
Handler[] handlers = getHandlers();
|
||||
if (handlers==null)
|
||||
{
|
||||
_pathBranches=new ArrayTernaryTrie<>(false,16);
|
||||
return;
|
||||
|
@ -93,7 +94,7 @@ public class ContextHandlerCollection extends HandlerCollection
|
|||
|
||||
// Create map of contextPath to handler Branch
|
||||
Map<String,Branch[]> map = new HashMap<>();
|
||||
for (Handler handler:getHandlers())
|
||||
for (Handler handler:handlers)
|
||||
{
|
||||
Branch branch=new Branch(handler);
|
||||
for (String contextPath : branch.getContextPaths())
|
||||
|
|
|
@ -184,8 +184,9 @@ public class HandlerCollection extends AbstractHandlerContainer
|
|||
@Override
|
||||
protected void expandChildren(List<Handler> list, Class<?> byClass)
|
||||
{
|
||||
if (getHandlers()!=null)
|
||||
for (Handler h:getHandlers())
|
||||
Handler[] handlers = getHandlers();
|
||||
if (handlers!=null)
|
||||
for (Handler h:handlers)
|
||||
expandHandler(h, list, byClass);
|
||||
}
|
||||
|
||||
|
@ -207,6 +208,6 @@ public class HandlerCollection extends AbstractHandlerContainer
|
|||
public String toString()
|
||||
{
|
||||
Handler[] handlers=getHandlers();
|
||||
return super.toString()+(handlers==null?"[]":Arrays.asList(getHandlers()).toString());
|
||||
return super.toString()+(handlers==null?"[]":Arrays.asList(handlers).toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue