diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-28 10:58:43 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-11-28 10:58:55 +0200 |
commit | 42f402de0e2ecb9e2816156ed78225cb41258390 (patch) | |
tree | 697c7f30d909e6f4621a5c7bfdd01758c227f403 /server | |
parent | c78e03fa5907845f745203da925f0264b1b3befc (diff) | |
download | vaadin-framework-42f402de0e2ecb9e2816156ed78225cb41258390.tar.gz vaadin-framework-42f402de0e2ecb9e2816156ed78225cb41258390.zip |
Avoid using the same Matcher from multiple threads (#10184)
Change-Id: I801a60db3a1b040db98fc597a35434c4a0b2ba83
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/GlobalResourceHandler.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/server/src/com/vaadin/server/GlobalResourceHandler.java b/server/src/com/vaadin/server/GlobalResourceHandler.java index 13dbd006a4..acaa6a168e 100644 --- a/server/src/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/com/vaadin/server/GlobalResourceHandler.java @@ -60,9 +60,9 @@ public class GlobalResourceHandler implements RequestHandler { 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, @@ -72,7 +72,7 @@ public class GlobalResourceHandler implements RequestHandler { return false; } - matcher.reset(pathInfo); + Matcher matcher = pattern.matcher(pathInfo); if (!matcher.matches()) { return false; } @@ -81,9 +81,6 @@ public class GlobalResourceHandler implements RequestHandler { 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"); |