Fix an issue introduced with r1541641, by finally using synchronized that I tried to avoid

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1541746 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2013-11-13 22:04:33 +00:00
parent e4529567c2
commit d692b2df2c
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
@@ -1186,8 +1187,11 @@ public class ProductEvents {
if (UtilValidate.isNotEmpty(productId) && UtilValidate.isNotEmpty(productTags)) {
List<String> matchList = FastList.newInstance();
Pattern regex = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'");
while (regex.matcher(productTags).find()) {
matchList.add(regex.matcher(productTags).group().replace("'", ""));
Matcher regexMatcher = regex.matcher(productTags);
synchronized (regexMatcher) {
while (regexMatcher.find()) {
matchList.add(regexMatcher.group().replace("'", ""));
}
}
GenericValue userLogin = null;