You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by df...@apache.org on 2001/06/18 16:34:13 UTC
cvs commit: jakarta-oro/src/java/org/apache/oro/text GlobCompiler.java
dfs 01/06/18 07:34:12
Modified: src/java/org/apache/oro/text GlobCompiler.java
Log:
Added READ_ONLY_MASK corresponding to Perl5Compiler.READ_ONLY_MASK.
Revision Changes Path
1.5 +17 -1 jakarta-oro/src/java/org/apache/oro/text/GlobCompiler.java
Index: GlobCompiler.java
===================================================================
RCS file: /home/cvs/jakarta-oro/src/java/org/apache/oro/text/GlobCompiler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- GlobCompiler.java 2001/05/20 23:55:18 1.4
+++ GlobCompiler.java 2001/06/18 14:34:06 1.5
@@ -58,7 +58,7 @@
*/
/*
- * $Id: GlobCompiler.java,v 1.4 2001/05/20 23:55:18 dfs Exp $
+ * $Id: GlobCompiler.java,v 1.5 2001/06/18 14:34:06 dfs Exp $
*/
import org.apache.oro.text.regex.*;
@@ -148,6 +148,20 @@
*/
public static final int QUESTION_MATCHES_ZERO_OR_ONE_MASK = 0x0004;
+ /**
+ * A mask passed as an option to the {@link #compile compile} methods
+ * to indicate that the resulting Perl5Pattern should be treated as a
+ * read only data structure by Perl5Matcher, making it safe to share
+ * a single Perl5Pattern instance among multiple threads without needing
+ * synchronization. Without this option, Perl5Matcher reserves the right
+ * to store heuristic or other information in Perl5Pattern that might
+ * accelerate future matches. When you use this option, Perl5Matcher will
+ * not store or modify any information in a Perl5Pattern. Use this option
+ * when you want to share a Perl5Pattern instance among multiple threads
+ * using different Perl5Matcher instances.
+ */
+ public static final int READ_ONLY_MASK = 0x0008;
+
private Perl5Compiler __perl5Compiler;
private static boolean __isPerl5MetaCharacter(char ch) {
@@ -289,6 +303,8 @@
int perlOptions = 0;
if((options & CASE_INSENSITIVE_MASK) != 0)
perlOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK;
+ if((options & READ_ONLY_MASK) != 0)
+ perlOptions |= Perl5Compiler.READ_ONLY_MASK;
return __perl5Compiler.compile(globToPerl5(pattern, options), perlOptions);
}