private int nextLegacyId = 0;
// APP/global/[uiid]/[type]/[id]
- private static final Matcher matcher = Pattern.compile(
- "^/?" + ApplicationConstants.APP_PATH + '/' + RESOURCE_REQUEST_PATH
- + "(\\d+)/(([^/]+)(/.*))").matcher("");
+ private static final Pattern pattern = Pattern.compile("^/?"
+ + ApplicationConstants.APP_PATH + '/' + RESOURCE_REQUEST_PATH
+ + "(\\d+)/(([^/]+)(/.*))");
@Override
public boolean handleRequest(VaadinSession session, VaadinRequest request,
return false;
}
- matcher.reset(pathInfo);
+ Matcher matcher = pattern.matcher(pathInfo);
if (!matcher.matches()) {
return false;
}
String type = matcher.group(3);
String key = matcher.group(2);
- // Allow GCing pathInfo string
- matcher.reset();
-
if (key == null) {
return error(request, response, pathInfo
+ " is not a valid global resource path");