Skip to content
Permalink
Browse files
Field can be final
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/jxpath/trunk@1716246 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
britter committed Nov 24, 2015
1 parent 52f7a43 commit 88bd284db41e8f8055c0d9e1866329b88f45fe5e
Showing 1 changed file with 5 additions and 5 deletions.
@@ -31,7 +31,7 @@
*/
public class Parser {

private static XPathParser parser = new XPathParser(new StringReader(""));
private static final XPathParser PARSER = new XPathParser(new StringReader(""));

/**
* Parses the XPath expression. Throws a JXPathException in case
@@ -43,12 +43,12 @@ public class Parser {
public static Object parseExpression(
String expression,
Compiler compiler) {
synchronized (parser) {
parser.setCompiler(compiler);
synchronized (PARSER) {
PARSER.setCompiler(compiler);
Object expr;
try {
parser.ReInit(new StringReader(expression));
expr = parser.parseExpression();
PARSER.ReInit(new StringReader(expression));
expr = PARSER.parseExpression();
}
catch (TokenMgrError e) {
throw new JXPathInvalidSyntaxException(

0 comments on commit 88bd284

Please sign in to comment.