Fixed ClassCastException.
Cannot cast Handler[] down to ContextHandlerCollection[]. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
36700bec50
commit
3eda16988c
|
@ -1605,10 +1605,13 @@ public class ContextHandler extends ScopedHandler implements Attributes, Gracefu
|
||||||
|
|
||||||
if (getServer() != null && (getServer().isStarting() || getServer().isStarted()))
|
if (getServer() != null && (getServer().isStarting() || getServer().isStarted()))
|
||||||
{
|
{
|
||||||
ContextHandlerCollection[] contextCollections =
|
Class<ContextHandlerCollection> handlerClass = ContextHandlerCollection.class;
|
||||||
(ContextHandlerCollection[])getServer().getChildHandlersByClass(ContextHandlerCollection.class);
|
Handler[] contextCollections = getServer().getChildHandlersByClass(handlerClass);
|
||||||
for (int h = 0; contextCollections != null && h < contextCollections.length; h++)
|
if (contextCollections != null)
|
||||||
contextCollections[h].mapContexts();
|
{
|
||||||
|
for (Handler contextCollection : contextCollections)
|
||||||
|
handlerClass.cast(contextCollection).mapContexts();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue