if (invoker instanceof ResourceLocator)
{
PathParamSegment segmentNode = locatorExpressions.get(expression);
if (segmentNode != null)
throw new LoggableFailure("You cannot have 2 locators for same path: " + expression);
segmentNode = new PathParamSegment(expression);
segmentNode.locator = (ResourceLocator) invoker;
locatorExpressions.put(segmentNode.getPathExpression(), segmentNode);
sortedLocatorExpressions.add(segmentNode);
Collections.sort(sortedLocatorExpressions);