QueryHelper Based Filter Strings With An Unbalanced Quote Cause An "OutOfMemoryException" in Coherence 3.6 (Doc ID 1271531.1)

Last updated on NOVEMBER 03, 2016

Applies to:

Oracle Coherence - Version 3.6.0 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Mar-2013***

Symptoms

QueryHelper based filter strings with an unbalanced quote cause an OutOfMemoryException.

For example, the code line below:

Filter filter = QueryHelper.createFilter("value() = 'unbalancedQuote") ; //Note that a trailing single quote is not present


will throw an exception message like the following:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:572)
at java.lang.StringBuffer.append(StringBuffer.java:320)
at com.tangosol.coherence.dsltools.base.BaseTokenScanner.takeCurrentCharAndAdvance(BaseTokenScanner.java:661)
at com.tangosol.coherence.dsltools.base.BaseTokenScanner.scanLiteral(BaseTokenScanner.java:304)
at com.tangosol.coherence.dsltools.base.BaseTokenScanner.next(BaseTokenScanner.java:143)
at com.tangosol.coherence.dsltools.base.BaseTokenScanner.scan(BaseTokenScanner.java:70)
at com.tangosol.coherence.dsltools.precedence.OPScanner.scan(OPScanner.java:55)
at com.tangosol.coherence.dsltools.precedence.OPParser.<init>(OPParser.java:98)
at com.tangosol.coherence.dsltools.precedence.OPParser.<init>(OPParser.java:85)
at com.tangosol.util.QueryHelper.createFilter(QueryHelper.java:147)
at com.tangosol.util.QueryHelper.createFilter(QueryHelper.java:94)
at com.oracle.coherence.handson.YourFirstCoherenceApplication.main(YourFirstCoherenceApplication.java:23)

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms