Source:
<code>public static BooleanExpression parse(String sql) throws FilterException { Object result = cache.get(sql); if (result instanceof FilterException) { throw (FilterException) result; } else if (result instanceof BooleanExpression) { return (BooleanExpression) result; } else { String actual = sql; boolean convertStringExpressions = false; boolean hyphenatedProps = false; while (true) { if (actual.startsWith(CONVERT_STRING_EXPRESSIONS_PREFIX)) { convertStringExpressions = true; actual = actual.substring(CONVERT_STRING_EXPRESSIONS_PREFIX.length()); continue; } if (actual.startsWith(HYPHENATED_PROPS_PREFIX)) { hyphenatedProps = true; actual = actual.substring(HYPHENATED_PROPS_PREFIX.length()); continue; } if (actual.startsWith(NO_CONVERT_STRING_EXPRESSIONS_PREFIX)) { convertStringExpressions = false; actual = actual.substring(NO_CONVERT_STRING_EXPRESSIONS_PREFIX.length()); continue; } if (actual.startsWith(NO_HYPHENATED_PROPS_PREFIX)) { hyphenatedProps = false; actual = actual.substring(NO_HYPHENATED_PROPS_PREFIX.length()); continue; } break; } if (convertStringExpressions) { ComparisonExpression.CONVERT_STRING_EXPRESSIONS.set(true); } try { BooleanExpression e = null; if (hyphenatedProps) { HyphenatedParser parser = new HyphenatedParser(new StringReader(actual)); e = parser.JmsSelector(); } else { StrictParser parser = new StrictParser(new StringReader(actual)); e = parser.JmsSelector(); } synchronized (cache) { cache.put(sql, e); } <START> return e; <END> } catch (Throwable e) { FilterException fe = new FilterException(actual, e); synchronized (cache) { cache.put(sql, fe); } throw fe; } finally { if (convertStringExpressions) { ComparisonExpression.CONVERT_STRING_EXPRESSIONS.remove(); } } } }</code><technical_language>a sync blocks. @franz1981 ideas</technical_language>

Target:
public static BooleanExpression parse(String sql) throws FilterException { String actual = sql; boolean convertStringExpressions = false; boolean hyphenatedProps = false; while (true) { if (actual.startsWith(CONVERT_STRING_EXPRESSIONS_PREFIX)) { convertStringExpressions = true; actual = actual.substring(CONVERT_STRING_EXPRESSIONS_PREFIX.length()); continue; } if (actual.startsWith(HYPHENATED_PROPS_PREFIX)) { hyphenatedProps = true; actual = actual.substring(HYPHENATED_PROPS_PREFIX.length()); continue; } if (actual.startsWith(NO_CONVERT_STRING_EXPRESSIONS_PREFIX)) { convertStringExpressions = false; actual = actual.substring(NO_CONVERT_STRING_EXPRESSIONS_PREFIX.length()); continue; } if (actual.startsWith(NO_HYPHENATED_PROPS_PREFIX)) { hyphenatedProps = false; actual = actual.substring(NO_HYPHENATED_PROPS_PREFIX.length()); continue; } break; } if (convertStringExpressions) { ComparisonExpression.CONVERT_STRING_EXPRESSIONS.set(true); } try { BooleanExpression e = null; if (hyphenatedProps) { HyphenatedParser parser = new HyphenatedParser(new StringReader(actual)); e = parser.JmsSelector(); } else { StrictParser parser = new StrictParser(new StringReader(actual)); e = parser.JmsSelector(); } return e; } catch (Throwable e) { FilterException fe = new FilterException(actual, e); throw fe; } finally { if (convertStringExpressions) { ComparisonExpression.CONVERT_STRING_EXPRESSIONS.remove(); } } }