The correct syntax for
Perl5Compiler.CASE_INSENSITIVE_MASK & Perl5Compiler.READ_ONLY_MASK
is
Perl5Compiler.CASE_INSENSITIVE_MASK | Perl5Compiler.READ_ONLY_MASK
See <<
https://jakarta.apache.org/oro/api/org/apache/oro/text/regex/Perl5Compiler.html#compile(java.lang.String, int)>> (copy the whole string between <<...>>)
Jacques
On Saturday, November 16, 2013 8:03 PM
[hidden email] <
[hidden email]> wrote:
> Author: adrianc
> Date: Sat Nov 16 19:03:17 2013
> New Revision: 1542551
>
> URL:
http://svn.apache.org/r1542551> Log:
> Small fixup for me previous commit - Perl5 pattern compiler needs to be told the patterns will be shared among threads.
>
> Modified:
> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/PatternFactory.java
>
> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/PatternFactory.java
> URL:
>
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/PatternFactory.java?rev=1542551&r1=1542550&r2=1542551&view=diff> ============================================================================== ---
> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/PatternFactory.java (original) +++
> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/PatternFactory.java Sat Nov 16 19:03:17 2013 @@ -45,9 +45,9 @@ public class
> PatternFactory { if (pattern == null) {
> Perl5Compiler compiler = new Perl5Compiler();
> if (caseSensitive) {
> - pattern = compiler.compile(stringPattern);
> + pattern = compiler.compile(stringPattern, Perl5Compiler.READ_ONLY_MASK);
> } else {
> - pattern = compiler.compile(stringPattern, Perl5Compiler.CASE_INSENSITIVE_MASK);
> + pattern = compiler.compile(stringPattern, Perl5Compiler.CASE_INSENSITIVE_MASK & Perl5Compiler.READ_ONLY_MASK);
> }
> pattern = compiledPerl5Patterns.putIfAbsentAndGet(stringPattern, pattern);
> if (Debug.verboseOn()) {