Lines 26-32
Link Here
|
26 |
|
26 |
|
27 |
protected RewriteCond[] conditions = new RewriteCond[0]; |
27 |
protected RewriteCond[] conditions = new RewriteCond[0]; |
28 |
|
28 |
|
29 |
protected static ThreadLocal<Pattern> pattern = new ThreadLocal<>(); |
29 |
protected ThreadLocal<Pattern> pattern = new ThreadLocal<>(); |
30 |
protected Substitution substitution = null; |
30 |
protected Substitution substitution = null; |
31 |
|
31 |
|
32 |
protected String patternString = null; |
32 |
protected String patternString = null; |
Lines 86-92
Link Here
|
86 |
* @return <code>null</code> if no rewrite took place |
86 |
* @return <code>null</code> if no rewrite took place |
87 |
*/ |
87 |
*/ |
88 |
public CharSequence evaluate(CharSequence url, Resolver resolver) { |
88 |
public CharSequence evaluate(CharSequence url, Resolver resolver) { |
89 |
Pattern pattern = RewriteRule.pattern.get(); |
89 |
Pattern pattern = this.pattern.get(); |
90 |
if (pattern == null) { |
90 |
if (pattern == null) { |
91 |
// Parse the pattern |
91 |
// Parse the pattern |
92 |
int flags = 0; |
92 |
int flags = 0; |
Lines 94-100
Link Here
|
94 |
flags |= Pattern.CASE_INSENSITIVE; |
94 |
flags |= Pattern.CASE_INSENSITIVE; |
95 |
} |
95 |
} |
96 |
pattern = Pattern.compile(patternString, flags); |
96 |
pattern = Pattern.compile(patternString, flags); |
97 |
RewriteRule.pattern.set(pattern); |
97 |
this.pattern.set(pattern); |
98 |
} |
98 |
} |
99 |
Matcher matcher = pattern.matcher(url); |
99 |
Matcher matcher = pattern.matcher(url); |
100 |
// Use XOR |
100 |
// Use XOR |