Author: sandygao Date: Mon May 30 19:18:04 2011 New Revision: 1129306 URL: http://svn.apache.org/viewvc?rev=1129306&view=rev Log: Fixing Jira bug XERCESJ-1511 (https://issues.apache.org/jira/browse/XERCESJ-1511), by making sure that when a pattern is fully parsed, the last token is EOF. That is, it's an error if the last token is a closing parenthesis.
Modified: xerces/java/trunk/src/org/apache/xerces/impl/xpath/regex/RegexParser.java Modified: xerces/java/trunk/src/org/apache/xerces/impl/xpath/regex/RegexParser.java URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/xpath/regex/RegexParser.java?rev=1129306&r1=1129305&r2=1129306&view=diff ============================================================================== --- xerces/java/trunk/src/org/apache/xerces/impl/xpath/regex/RegexParser.java (original) +++ xerces/java/trunk/src/org/apache/xerces/impl/xpath/regex/RegexParser.java Mon May 30 19:18:04 2011 @@ -128,6 +128,9 @@ class RegexParser { Token ret = this.parseRegex(); if (this.offset != this.regexlen) throw ex("parser.parse.1", this.offset); + if (this.read() != T_EOF) { + throw ex("parser.parse.1", this.offset-1); + } if (this.references != null) { for (int i = 0; i < this.references.size(); i ++) { ReferencePosition position = (ReferencePosition)this.references.elementAt(i); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@xerces.apache.org For additional commands, e-mail: commits-h...@xerces.apache.org