Collection<ResourceMethodOrLocator> eWithMethod = new ArrayList<ResourceMethodOrLocator>();
// (c) and (d) Filter E: remove members do not match U or final
// match not empty
for (ResourceMethodOrLocator methodOrLocator : resClass
.getResourceMethodsAndLocators()) {
PathRegExp pathRegExp = methodOrLocator.getPathRegExp();
MatchingResult matchingResult = pathRegExp.match(u);
if (matchingResult == null)
continue;
if (matchingResult.getFinalCapturingGroup().isEmptyOrSlash())
eWithMethod.add(methodOrLocator);
// the following is added by Stephan (is not in spec 2008-03-06)
else if (methodOrLocator instanceof SubResourceLocator)
eWithMethod.add(methodOrLocator);
}
// (e) If E is empty -> HTTP 404
if (eWithMethod.isEmpty())
excHandler.resourceNotFound();// NICE (o.getClass(), u);
// (f) and (g) sort E, use first member of E
ResourceMethodOrLocator firstMeth = getFirstByNoOfLiteralCharsNoOfCapturingGroups(eWithMethod);
PathRegExp rMatch = firstMeth.getPathRegExp();
MatchingResult matchingResult = rMatch.match(u);
addPathVarsToMap(matchingResult, callContext);
// (h) When Method is resource method
if (firstMeth instanceof ResourceMethod)