Author: shawkins
Date: 2012-02-06 21:12:28 -0500 (Mon, 06 Feb 2012)
New Revision: 3850
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java
Log:
TEIID-1820 cache access should be synchronized
Modified: branches/7.7.x/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java
===================================================================
---
branches/7.7.x/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java 2012-02-06
17:46:12 UTC (rev 3849)
+++
branches/7.7.x/engine/src/main/java/org/teiid/query/sql/lang/MatchCriteria.java 2012-02-07
02:12:28 UTC (rev 3850)
@@ -281,11 +281,16 @@
public Pattern translate(String pattern, char escape) throws
ExpressionEvaluationException {
List<?> key = Arrays.asList(pattern, escape);
- Pattern result = cache.get(key);
+ Pattern result = null;
+ synchronized (cache) {
+ result = cache.get(key);
+ }
if (result == null) {
String newPattern = getPatternString(pattern, escape);
result = getPattern(newPattern, pattern, flags);
- cache.put(key, result);
+ synchronized (cache) {
+ cache.put(key, result);
+ }
}
return result;
}
Show replies by date