Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.3.20
-
None
Description
The current set of patterns can be consolidated without sacrificing readability for a significant gain in efficiency. I ran both sets of equivalent patterns against the three test methods in DefaultExcludedPatternsCheckerTest 100,000 times, and the consolidated pattern was 3 times faster.
public static final String[] EXCLUDED_PATTERNS = { "(.*\\.|^|.*|\\[('|\"))\\bclass(\\.|('|\")]|\\[).*", "(^|.*#)(dojo|struts|session|request|application|servlet(Request|Response)" + "|parameters|context|_memberAccess)(\\.|\\[).*" };