Author: remy.maucherat(a)jboss.com
Date: 2010-08-31 12:35:24 -0400 (Tue, 31 Aug 2010)
New Revision: 1547
Modified:
trunk/java/org/apache/el/parser/ELParser.java
trunk/java/org/apache/el/parser/ELParser.jjt
trunk/java/org/apache/el/parser/ELParserTreeConstants.java
trunk/java/org/apache/el/parser/JJTELParserState.java
trunk/java/org/apache/el/parser/ParseException.java
trunk/java/org/apache/el/parser/SimpleCharStream.java
trunk/java/org/apache/el/parser/Token.java
trunk/java/org/apache/el/parser/TokenMgrError.java
trunk/webapps/docs/changelog.xml
Log:
- JBAS-8374: Fix EL parsing edge case, after checking the grammar indeed allows that
form.
Modified: trunk/java/org/apache/el/parser/ELParser.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParser.java 2010-08-27 11:54:53 UTC (rev 1546)
+++ trunk/java/org/apache/el/parser/ELParser.java 2010-08-31 16:35:24 UTC (rev 1547)
@@ -1134,7 +1134,25 @@
* Method parameters
*/
final public void Parameters() throws ParseException {
- Expression();
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case INTEGER_LITERAL:
+ case FLOATING_POINT_LITERAL:
+ case STRING_LITERAL:
+ case TRUE:
+ case FALSE:
+ case NULL:
+ case LPAREN:
+ case NOT0:
+ case NOT1:
+ case EMPTY:
+ case MINUS:
+ case IDENTIFIER:
+ Expression();
+ break;
+ default:
+ jj_la1[29] = jj_gen;
+ ;
+ }
label_10:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
@@ -1142,7 +1160,7 @@
;
break;
default:
- jj_la1[29] = jj_gen;
+ jj_la1[30] = jj_gen;
break label_10;
}
jj_consume_token(COMMA);
@@ -1162,7 +1180,7 @@
jj_consume_token(RPAREN);
break;
default:
- jj_la1[30] = jj_gen;
+ jj_la1[31] = jj_gen;
if (jj_2_2(2147483647)) {
Function();
} else {
@@ -1171,7 +1189,7 @@
Identifier();
break;
default:
- jj_la1[31] = jj_gen;
+ jj_la1[32] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
@@ -1246,7 +1264,7 @@
;
break;
default:
- jj_la1[32] = jj_gen;
+ jj_la1[33] = jj_gen;
break label_11;
}
jj_consume_token(COMMA);
@@ -1254,7 +1272,7 @@
}
break;
default:
- jj_la1[33] = jj_gen;
+ jj_la1[34] = jj_gen;
;
}
jj_consume_token(RPAREN);
@@ -1302,7 +1320,7 @@
Null();
break;
default:
- jj_la1[34] = jj_gen;
+ jj_la1[35] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
@@ -1339,7 +1357,7 @@
}
break;
default:
- jj_la1[35] = jj_gen;
+ jj_la1[36] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
@@ -1961,7 +1979,7 @@
private Token jj_scanpos, jj_lastpos;
private int jj_la;
private int jj_gen;
- final private int[] jj_la1 = new int[36];
+ final private int[] jj_la1 = new int[37];
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static {
@@ -1969,10 +1987,10 @@
jj_la1_init_1();
}
private static void jj_la1_init_0() {
- jj_la1_0 = new int[]
{0xe,0xe,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x80000000,0x7f800000,0x6000000,0x1800000,0x60000000,0x18000000,0x7f800000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x27b00,0x90000,0x27b00,0x90000,0x20000,0x20000,0x400000,0x20000,0x0,0x400000,0x27b00,0x7b00,0x3000,};
+ jj_la1_0 = new int[]
{0xe,0xe,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x80000000,0x7f800000,0x6000000,0x1800000,0x60000000,0x18000000,0x7f800000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x27b00,0x90000,0x27b00,0x90000,0x20000,0x20000,0x27b00,0x400000,0x20000,0x0,0x400000,0x27b00,0x7b00,0x3000,};
}
private static void jj_la1_init_1() {
- jj_la1_1 = new int[]
{0x0,0x0,0x180,0x180,0x60,0x60,0x7,0x1,0x6,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x3000,0x3000,0x78800,0x18000,0x60000,0x78800,0x18,0x82218,0x0,0x80000,0x0,0x0,0x0,0x0,0x0,0x80000,0x0,0x82218,0x0,0x0,};
+ jj_la1_1 = new int[]
{0x0,0x0,0x180,0x180,0x60,0x60,0x7,0x1,0x6,0x7,0x0,0x0,0x0,0x0,0x0,0x0,0x3000,0x3000,0x78800,0x18000,0x60000,0x78800,0x18,0x82218,0x0,0x80000,0x0,0x0,0x0,0x82218,0x0,0x0,0x80000,0x0,0x82218,0x0,0x0,};
}
final private JJCalls[] jj_2_rtns = new JJCalls[3];
private boolean jj_rescan = false;
@@ -1989,7 +2007,7 @@
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 36; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 37; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -2005,7 +2023,7 @@
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
- for (int i = 0; i < 36; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 37; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -2016,7 +2034,7 @@
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 36; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 37; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -2028,7 +2046,7 @@
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
- for (int i = 0; i < 36; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 37; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -2038,7 +2056,7 @@
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 36; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 37; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -2049,7 +2067,7 @@
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
- for (int i = 0; i < 36; i++) jj_la1[i] = -1;
+ for (int i = 0; i < 37; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
@@ -2127,7 +2145,7 @@
return (jj_ntk = jj_nt.kind);
}
- private java.util.List jj_expentries = new java.util.ArrayList();
+ private java.util.List<int[]> jj_expentries = new
java.util.ArrayList<int[]>();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
@@ -2142,7 +2160,7 @@
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
- jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator();
it.hasNext();) {
+ jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator();
it.hasNext();) {
int[] oldentry = (int[])(it.next());
if (oldentry.length == jj_expentry.length) {
for (int i = 0; i < jj_expentry.length; i++) {
@@ -2166,7 +2184,7 @@
la1tokens[jj_kind] = true;
jj_kind = -1;
}
- for (int i = 0; i < 36; i++) {
+ for (int i = 0; i < 37; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ((jj_la1_0[i] & (1<<j)) != 0) {
@@ -2190,7 +2208,7 @@
jj_add_error_token(0, 0);
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++) {
- exptokseq[i] = (int[])jj_expentries.get(i);
+ exptokseq[i] = jj_expentries.get(i);
}
return new ParseException(token, exptokseq, tokenImage);
}
Modified: trunk/java/org/apache/el/parser/ELParser.jjt
===================================================================
--- trunk/java/org/apache/el/parser/ELParser.jjt 2010-08-27 11:54:53 UTC (rev 1546)
+++ trunk/java/org/apache/el/parser/ELParser.jjt 2010-08-31 16:35:24 UTC (rev 1547)
@@ -259,7 +259,7 @@
*/
void Parameters() : {}
{
- Expression() (<COMMA> Expression())*
+ (Expression())? (<COMMA> Expression())*
}
/*
Modified: trunk/java/org/apache/el/parser/ELParserTreeConstants.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParserTreeConstants.java 2010-08-27 11:54:53 UTC
(rev 1546)
+++ trunk/java/org/apache/el/parser/ELParserTreeConstants.java 2010-08-31 16:35:24 UTC
(rev 1547)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. ELParserTreeConstants.java Version 4.1 */
+/* Generated By:JavaCC: Do not edit this line. ELParserTreeConstants.java Version 5.0 */
package org.apache.el.parser;
public interface ELParserTreeConstants
@@ -74,4 +74,4 @@
"Null",
};
}
-/* JavaCC - OriginalChecksum=bf4d2e0f35a3199e11bfd8303212d1ad (do not edit this line) */
+/* JavaCC - OriginalChecksum=f9dfeaba39219034209bcc010ceeafc5 (do not edit this line) */
Modified: trunk/java/org/apache/el/parser/JJTELParserState.java
===================================================================
--- trunk/java/org/apache/el/parser/JJTELParserState.java 2010-08-27 11:54:53 UTC (rev
1546)
+++ trunk/java/org/apache/el/parser/JJTELParserState.java 2010-08-31 16:35:24 UTC (rev
1547)
@@ -1,17 +1,17 @@
-/* Generated By:JavaCC: Do not edit this line. JJTELParserState.java Version 4.1 */
+/* Generated By:JavaCC: Do not edit this line. JJTELParserState.java Version 5.0 */
package org.apache.el.parser;
public class JJTELParserState {
- private java.util.List nodes;
- private java.util.List marks;
+ private java.util.List<Node> nodes;
+ private java.util.List<Integer> marks;
private int sp; // number of nodes on stack
private int mk; // current mark
private boolean node_created;
public JJTELParserState() {
- nodes = new java.util.ArrayList();
- marks = new java.util.ArrayList();
+ nodes = new java.util.ArrayList<Node>();
+ marks = new java.util.ArrayList<Integer>();
sp = 0;
mk = 0;
}
@@ -35,7 +35,7 @@
/* Returns the root node of the AST. It only makes sense to call
this after a successful parse. */
public Node rootNode() {
- return (Node)nodes.get(0);
+ return nodes.get(0);
}
/* Pushes a node on to the stack. */
@@ -48,14 +48,14 @@
stack. */
public Node popNode() {
if (--sp < mk) {
- mk = ((Integer)marks.remove(marks.size()-1)).intValue();
+ mk = marks.remove(marks.size()-1);
}
- return (Node)nodes.remove(nodes.size()-1);
+ return nodes.remove(nodes.size()-1);
}
/* Returns the node currently on the top of the stack. */
public Node peekNode() {
- return (Node)nodes.get(nodes.size()-1);
+ return nodes.get(nodes.size()-1);
}
/* Returns the number of children on the stack in the current node
@@ -69,12 +69,12 @@
while (sp > mk) {
popNode();
}
- mk = ((Integer)marks.remove(marks.size()-1)).intValue();
+ mk = marks.remove(marks.size()-1);
}
public void openNodeScope(Node n) {
- marks.add(new Integer(mk));
+ marks.add(mk);
mk = sp;
n.jjtOpen();
}
@@ -85,7 +85,7 @@
made the children of the definite node. Then the definite node
is pushed on to the stack. */
public void closeNodeScope(Node n, int num) {
- mk = ((Integer)marks.remove(marks.size()-1)).intValue();
+ mk = marks.remove(marks.size()-1);
while (num-- > 0) {
Node c = popNode();
c.jjtSetParent(n);
@@ -105,7 +105,7 @@
public void closeNodeScope(Node n, boolean condition) {
if (condition) {
int a = nodeArity();
- mk = ((Integer)marks.remove(marks.size()-1)).intValue();
+ mk = marks.remove(marks.size()-1);
while (a-- > 0) {
Node c = popNode();
c.jjtSetParent(n);
@@ -115,9 +115,9 @@
pushNode(n);
node_created = true;
} else {
- mk = ((Integer)marks.remove(marks.size()-1)).intValue();
+ mk = marks.remove(marks.size()-1);
node_created = false;
}
}
}
-/* JavaCC - OriginalChecksum=302852ad347878d613824b11862fef15 (do not edit this line) */
+/* JavaCC - OriginalChecksum=70ac39f1e0e1eed7476e1dae2dfa25fa (do not edit this line) */
Modified: trunk/java/org/apache/el/parser/ParseException.java
===================================================================
--- trunk/java/org/apache/el/parser/ParseException.java 2010-08-27 11:54:53 UTC (rev
1546)
+++ trunk/java/org/apache/el/parser/ParseException.java 2010-08-31 16:35:24 UTC (rev
1547)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 4.1 */
+/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
/* JavaCCOptions:KEEP_LINE_COL=null */
package org.apache.el.parser;
@@ -14,24 +14,24 @@
public class ParseException extends Exception {
/**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
* This constructor is used by the method "generateParseException"
* in the generated parser. Calling this constructor generates
* a new object of this type with the fields "currentToken",
- * "expectedTokenSequences", and "tokenImage" set. The boolean
- * flag "specialConstructor" is also set to true to indicate that
- * this constructor was used to create this object.
- * This constructor calls its super class with the empty string
- * to force the "toString" method of parent class "Throwable" to
- * print the error message in the form:
- * ParseException: <result of getMessage>
+ * "expectedTokenSequences", and "tokenImage" set.
*/
public ParseException(Token currentTokenVal,
int[][] expectedTokenSequencesVal,
String[] tokenImageVal
)
{
- super("");
- specialConstructor = true;
+ super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
currentToken = currentTokenVal;
expectedTokenSequences = expectedTokenSequencesVal;
tokenImage = tokenImageVal;
@@ -49,21 +49,13 @@
public ParseException() {
super();
- specialConstructor = false;
}
/** Constructor with message. */
public ParseException(String message) {
super(message);
- specialConstructor = false;
}
- /**
- * This variable determines which constructor was used to create
- * this object and thereby affects the semantics of the
- * "getMessage" method (see below).
- */
- protected boolean specialConstructor;
/**
* This is the last token that has been consumed successfully. If
@@ -87,19 +79,16 @@
public String[] tokenImage;
/**
- * This method has the standard behavior when this object has been
- * created using the standard constructors. Otherwise, it uses
- * "currentToken" and "expectedTokenSequences" to generate a parse
+ * It uses "currentToken" and "expectedTokenSequences" to generate
a parse
* error message and returns it. If this object has been created
* due to a parse error, and you do not catch it (it gets thrown
- * from the parser), then this method is called during the printing
- * of the final stack trace, and hence the correct error message
+ * from the parser) the correct error message
* gets displayed.
*/
- public String getMessage() {
- if (!specialConstructor) {
- return super.getMessage();
- }
+ private static String initialise(Token currentToken,
+ int[][] expectedTokenSequences,
+ String[] tokenImage) {
+ String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
@@ -149,7 +138,7 @@
* when these raw version cannot be used as part of an ASCII
* string literal.
*/
- protected String add_escapes(String str) {
+ static String add_escapes(String str) {
StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
@@ -195,4 +184,4 @@
}
}
-/* JavaCC - OriginalChecksum=8e2ccd67f74aad88b27a1262c61e9157 (do not edit this line) */
+/* JavaCC - OriginalChecksum=87586a39aa89f164889cc59bc6a7e7ad (do not edit this line) */
Modified: trunk/java/org/apache/el/parser/SimpleCharStream.java
===================================================================
--- trunk/java/org/apache/el/parser/SimpleCharStream.java 2010-08-27 11:54:53 UTC (rev
1546)
+++ trunk/java/org/apache/el/parser/SimpleCharStream.java 2010-08-31 16:35:24 UTC (rev
1547)
@@ -1,5 +1,5 @@
-/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 4.1 */
-/* JavaCCOptions:STATIC=false */
+/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */
+/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package org.apache.el.parser;
/**
@@ -38,192 +38,192 @@
protected void ExpandBuff(boolean wrapAround)
{
- char[] newbuffer = new char[bufsize + 2048];
- int newbufline[] = new int[bufsize + 2048];
- int newbufcolumn[] = new int[bufsize + 2048];
+ char[] newbuffer = new char[bufsize + 2048];
+ int newbufline[] = new int[bufsize + 2048];
+ int newbufcolumn[] = new int[bufsize + 2048];
- try
- {
- if (wrapAround)
- {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- System.arraycopy(buffer, 0, newbuffer,
- bufsize - tokenBegin, bufpos);
- buffer = newbuffer;
+ try
+ {
+ if (wrapAround)
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
+ buffer = newbuffer;
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
- bufline = newbufline;
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
+ bufline = newbufline;
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize -
tokenBegin);
- System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
- bufcolumn = newbufcolumn;
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
+ bufcolumn = newbufcolumn;
- maxNextCharInd = (bufpos += (bufsize - tokenBegin));
- }
- else
- {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- buffer = newbuffer;
+ maxNextCharInd = (bufpos += (bufsize - tokenBegin));
+ }
+ else
+ {
+ System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
+ buffer = newbuffer;
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- bufline = newbufline;
+ System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
+ bufline = newbufline;
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize -
tokenBegin);
- bufcolumn = newbufcolumn;
+ System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
+ bufcolumn = newbufcolumn;
- maxNextCharInd = (bufpos -= tokenBegin);
- }
- }
- catch (Throwable t)
- {
- throw new Error(t.getMessage());
- }
+ maxNextCharInd = (bufpos -= tokenBegin);
+ }
+ }
+ catch (Throwable t)
+ {
+ throw new Error(t.getMessage());
+ }
- bufsize += 2048;
- available = bufsize;
- tokenBegin = 0;
+ bufsize += 2048;
+ available = bufsize;
+ tokenBegin = 0;
}
protected void FillBuff() throws java.io.IOException
{
- if (maxNextCharInd == available)
- {
- if (available == bufsize)
+ if (maxNextCharInd == available)
+ {
+ if (available == bufsize)
+ {
+ if (tokenBegin > 2048)
{
- if (tokenBegin > 2048)
- {
- bufpos = maxNextCharInd = 0;
- available = tokenBegin;
- }
- else if (tokenBegin < 0)
- bufpos = maxNextCharInd = 0;
- else
- ExpandBuff(false);
+ bufpos = maxNextCharInd = 0;
+ available = tokenBegin;
}
- else if (available > tokenBegin)
- available = bufsize;
- else if ((tokenBegin - available) < 2048)
- ExpandBuff(true);
+ else if (tokenBegin < 0)
+ bufpos = maxNextCharInd = 0;
else
- available = tokenBegin;
- }
+ ExpandBuff(false);
+ }
+ else if (available > tokenBegin)
+ available = bufsize;
+ else if ((tokenBegin - available) < 2048)
+ ExpandBuff(true);
+ else
+ available = tokenBegin;
+ }
- int i;
- try {
- if ((i = inputStream.read(buffer, maxNextCharInd,
- available - maxNextCharInd)) == -1)
- {
- inputStream.close();
- throw new java.io.IOException();
- }
- else
- maxNextCharInd += i;
- return;
- }
- catch(java.io.IOException e) {
- --bufpos;
- backup(0);
- if (tokenBegin == -1)
- tokenBegin = bufpos;
- throw e;
- }
+ int i;
+ try {
+ if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) ==
-1)
+ {
+ inputStream.close();
+ throw new java.io.IOException();
+ }
+ else
+ maxNextCharInd += i;
+ return;
+ }
+ catch(java.io.IOException e) {
+ --bufpos;
+ backup(0);
+ if (tokenBegin == -1)
+ tokenBegin = bufpos;
+ throw e;
+ }
}
/** Start. */
public char BeginToken() throws java.io.IOException
{
- tokenBegin = -1;
- char c = readChar();
- tokenBegin = bufpos;
+ tokenBegin = -1;
+ char c = readChar();
+ tokenBegin = bufpos;
- return c;
+ return c;
}
protected void UpdateLineColumn(char c)
{
- column++;
+ column++;
- if (prevCharIsLF)
- {
- prevCharIsLF = false;
+ if (prevCharIsLF)
+ {
+ prevCharIsLF = false;
+ line += (column = 1);
+ }
+ else if (prevCharIsCR)
+ {
+ prevCharIsCR = false;
+ if (c == '\n')
+ {
+ prevCharIsLF = true;
+ }
+ else
line += (column = 1);
- }
- else if (prevCharIsCR)
- {
- prevCharIsCR = false;
- if (c == '\n')
- {
- prevCharIsLF = true;
- }
- else
- line += (column = 1);
- }
+ }
- switch (c)
- {
- case '\r' :
- prevCharIsCR = true;
- break;
- case '\n' :
- prevCharIsLF = true;
- break;
- case '\t' :
- column--;
- column += (tabSize - (column % tabSize));
- break;
- default :
- break;
- }
+ switch (c)
+ {
+ case '\r' :
+ prevCharIsCR = true;
+ break;
+ case '\n' :
+ prevCharIsLF = true;
+ break;
+ case '\t' :
+ column--;
+ column += (tabSize - (column % tabSize));
+ break;
+ default :
+ break;
+ }
- bufline[bufpos] = line;
- bufcolumn[bufpos] = column;
+ bufline[bufpos] = line;
+ bufcolumn[bufpos] = column;
}
/** Read a character. */
public char readChar() throws java.io.IOException
{
- if (inBuf > 0)
- {
- --inBuf;
+ if (inBuf > 0)
+ {
+ --inBuf;
- if (++bufpos == bufsize)
- bufpos = 0;
+ if (++bufpos == bufsize)
+ bufpos = 0;
- return buffer[bufpos];
- }
+ return buffer[bufpos];
+ }
- if (++bufpos >= maxNextCharInd)
- FillBuff();
+ if (++bufpos >= maxNextCharInd)
+ FillBuff();
- char c = buffer[bufpos];
+ char c = buffer[bufpos];
- UpdateLineColumn(c);
- return c;
+ UpdateLineColumn(c);
+ return c;
}
+ @Deprecated
/**
* @deprecated
* @see #getEndColumn
*/
public int getColumn() {
- return bufcolumn[bufpos];
+ return bufcolumn[bufpos];
}
+ @Deprecated
/**
* @deprecated
* @see #getEndLine
*/
public int getLine() {
- return bufline[bufpos];
+ return bufline[bufpos];
}
/** Get token end column number. */
public int getEndColumn() {
- return bufcolumn[bufpos];
+ return bufcolumn[bufpos];
}
/** Get token end line number. */
@@ -233,12 +233,12 @@
/** Get token beginning column number. */
public int getBeginColumn() {
- return bufcolumn[tokenBegin];
+ return bufcolumn[tokenBegin];
}
/** Get token beginning line number. */
public int getBeginLine() {
- return bufline[tokenBegin];
+ return bufline[tokenBegin];
}
/** Backup a number of characters. */
@@ -246,7 +246,7 @@
inBuf += amount;
if ((bufpos -= amount) < 0)
- bufpos += bufsize;
+ bufpos += bufsize;
}
/** Constructor. */
@@ -267,13 +267,13 @@
public SimpleCharStream(java.io.Reader dstream, int startline,
int startcolumn)
{
- this(dstream, startline, startcolumn, 4096);
+ this(dstream, startline, startcolumn, 4096);
}
/** Constructor. */
public SimpleCharStream(java.io.Reader dstream)
{
- this(dstream, 1, 1, 4096);
+ this(dstream, 1, 1, 4096);
}
/** Reinitialise. */
@@ -300,124 +300,124 @@
public void ReInit(java.io.Reader dstream, int startline,
int startcolumn)
{
- ReInit(dstream, startline, startcolumn, 4096);
+ ReInit(dstream, startline, startcolumn, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.Reader dstream)
{
- ReInit(dstream, 1, 1, 4096);
+ ReInit(dstream, 1, 1, 4096);
}
/** Constructor. */
public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
{
- this(encoding == null ? new java.io.InputStreamReader(dstream) : new
java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ this(encoding == null ? new java.io.InputStreamReader(dstream) : new
java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
/** Constructor. */
public SimpleCharStream(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
- this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
/** Constructor. */
public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
{
- this(dstream, encoding, startline, startcolumn, 4096);
+ this(dstream, encoding, startline, startcolumn, 4096);
}
/** Constructor. */
public SimpleCharStream(java.io.InputStream dstream, int startline,
int startcolumn)
{
- this(dstream, startline, startcolumn, 4096);
+ this(dstream, startline, startcolumn, 4096);
}
/** Constructor. */
public SimpleCharStream(java.io.InputStream dstream, String encoding) throws
java.io.UnsupportedEncodingException
{
- this(dstream, encoding, 1, 1, 4096);
+ this(dstream, encoding, 1, 1, 4096);
}
/** Constructor. */
public SimpleCharStream(java.io.InputStream dstream)
{
- this(dstream, 1, 1, 4096);
+ this(dstream, 1, 1, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws
java.io.UnsupportedEncodingException
{
- ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new
java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
+ ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new
java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
- ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
+ ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, String encoding) throws
java.io.UnsupportedEncodingException
{
- ReInit(dstream, encoding, 1, 1, 4096);
+ ReInit(dstream, encoding, 1, 1, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream)
{
- ReInit(dstream, 1, 1, 4096);
+ ReInit(dstream, 1, 1, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
{
- ReInit(dstream, encoding, startline, startcolumn, 4096);
+ ReInit(dstream, encoding, startline, startcolumn, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn)
{
- ReInit(dstream, startline, startcolumn, 4096);
+ ReInit(dstream, startline, startcolumn, 4096);
}
/** Get token literal value. */
public String GetImage()
{
- if (bufpos >= tokenBegin)
- return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
- else
- return new String(buffer, tokenBegin, bufsize - tokenBegin) +
- new String(buffer, 0, bufpos + 1);
+ if (bufpos >= tokenBegin)
+ return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
+ else
+ return new String(buffer, tokenBegin, bufsize - tokenBegin) +
+ new String(buffer, 0, bufpos + 1);
}
/** Get the suffix. */
public char[] GetSuffix(int len)
{
- char[] ret = new char[len];
+ char[] ret = new char[len];
- if ((bufpos + 1) >= len)
- System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
- else
- {
- System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
- len - bufpos - 1);
- System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
- }
+ if ((bufpos + 1) >= len)
+ System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
+ else
+ {
+ System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
+ len - bufpos - 1);
+ System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
+ }
- return ret;
+ return ret;
}
/** Reset buffer when finished. */
public void Done()
{
- buffer = null;
- bufline = null;
- bufcolumn = null;
+ buffer = null;
+ bufline = null;
+ bufcolumn = null;
}
/**
@@ -425,48 +425,47 @@
*/
public void adjustBeginLineColumn(int newLine, int newCol)
{
- int start = tokenBegin;
- int len;
+ int start = tokenBegin;
+ int len;
- if (bufpos >= tokenBegin)
- {
- len = bufpos - tokenBegin + inBuf + 1;
- }
- else
- {
- len = bufsize - tokenBegin + bufpos + 1 + inBuf;
- }
+ if (bufpos >= tokenBegin)
+ {
+ len = bufpos - tokenBegin + inBuf + 1;
+ }
+ else
+ {
+ len = bufsize - tokenBegin + bufpos + 1 + inBuf;
+ }
- int i = 0, j = 0, k = 0;
- int nextColDiff = 0, columnDiff = 0;
+ int i = 0, j = 0, k = 0;
+ int nextColDiff = 0, columnDiff = 0;
- while (i < len &&
- bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
- {
- bufline[j] = newLine;
- nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
- bufcolumn[j] = newCol + columnDiff;
- columnDiff = nextColDiff;
- i++;
- }
+ while (i < len && bufline[j = start % bufsize] == bufline[k = ++start %
bufsize])
+ {
+ bufline[j] = newLine;
+ nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
+ bufcolumn[j] = newCol + columnDiff;
+ columnDiff = nextColDiff;
+ i++;
+ }
- if (i < len)
- {
- bufline[j] = newLine++;
- bufcolumn[j] = newCol + columnDiff;
+ if (i < len)
+ {
+ bufline[j] = newLine++;
+ bufcolumn[j] = newCol + columnDiff;
- while (i++ < len)
- {
- if (bufline[j = start % bufsize] != bufline[++start % bufsize])
- bufline[j] = newLine++;
- else
- bufline[j] = newLine;
- }
- }
+ while (i++ < len)
+ {
+ if (bufline[j = start % bufsize] != bufline[++start % bufsize])
+ bufline[j] = newLine++;
+ else
+ bufline[j] = newLine;
+ }
+ }
- line = bufline[j];
- column = bufcolumn[j];
+ line = bufline[j];
+ column = bufcolumn[j];
}
}
-/* JavaCC - OriginalChecksum=818cc1c71ac884d7a3756c5d760b3c8f (do not edit this line) */
+/* JavaCC - OriginalChecksum=9ba0db3918bffb8019f00da1e421f339 (do not edit this line) */
Modified: trunk/java/org/apache/el/parser/Token.java
===================================================================
--- trunk/java/org/apache/el/parser/Token.java 2010-08-27 11:54:53 UTC (rev 1546)
+++ trunk/java/org/apache/el/parser/Token.java 2010-08-31 16:35:24 UTC (rev 1547)
@@ -1,14 +1,21 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 4.1 */
-/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null */
+/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
+/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true
*/
package org.apache.el.parser;
/**
* Describes the input token stream.
*/
-public class Token {
+public class Token implements java.io.Serializable {
/**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
* An integer that describes the kind of this token. This numbering
* system is determined by JavaCCParser, and a table of these numbers is
* stored in the file ...Constants.java.
@@ -75,7 +82,7 @@
*/
public Token(int kind)
{
- this(kind, null);
+ this(kind, null);
}
/**
@@ -83,8 +90,8 @@
*/
public Token(int kind, String image)
{
- this.kind = kind;
- this.image = image;
+ this.kind = kind;
+ this.image = image;
}
/**
@@ -92,7 +99,7 @@
*/
public String toString()
{
- return image;
+ return image;
}
/**
@@ -109,16 +116,16 @@
*/
public static Token newToken(int ofKind, String image)
{
- switch(ofKind)
- {
- default : return new Token(ofKind, image);
- }
+ switch(ofKind)
+ {
+ default : return new Token(ofKind, image);
+ }
}
public static Token newToken(int ofKind)
{
- return newToken(ofKind, null);
+ return newToken(ofKind, null);
}
}
-/* JavaCC - OriginalChecksum=7feb61b391e60d3d8ef1a9482b26365e (do not edit this line) */
+/* JavaCC - OriginalChecksum=3fc97649fffa8b13e1e03af022020b2f (do not edit this line) */
Modified: trunk/java/org/apache/el/parser/TokenMgrError.java
===================================================================
--- trunk/java/org/apache/el/parser/TokenMgrError.java 2010-08-27 11:54:53 UTC (rev 1546)
+++ trunk/java/org/apache/el/parser/TokenMgrError.java 2010-08-31 16:35:24 UTC (rev 1547)
@@ -1,4 +1,4 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 4.1 */
+/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
/* JavaCCOptions: */
package org.apache.el.parser;
@@ -6,135 +6,142 @@
public class TokenMgrError extends Error
{
- /*
- * Ordinals for various reasons why an Error of this type can be thrown.
- */
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the <i>serialized</i> form of the
+ * class changes.
+ */
+ private static final long serialVersionUID = 1L;
- /**
- * Lexical error occurred.
- */
- static final int LEXICAL_ERROR = 0;
+ /*
+ * Ordinals for various reasons why an Error of this type can be thrown.
+ */
- /**
- * An attempt was made to create a second instance of a static token manager.
- */
- static final int STATIC_LEXER_ERROR = 1;
+ /**
+ * Lexical error occurred.
+ */
+ static final int LEXICAL_ERROR = 0;
- /**
- * Tried to change to an invalid lexical state.
- */
- static final int INVALID_LEXICAL_STATE = 2;
+ /**
+ * An attempt was made to create a second instance of a static token manager.
+ */
+ static final int STATIC_LEXER_ERROR = 1;
- /**
- * Detected (and bailed out of) an infinite loop in the token manager.
- */
- static final int LOOP_DETECTED = 3;
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
- /**
- * Indicates the reason why the exception is thrown. It will have
- * one of the above 4 values.
- */
- int errorCode;
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
- /**
- * Replaces unprintable characters by their escaped (or unicode escaped)
- * equivalents in the given string
- */
- protected static final String addEscapes(String str) {
- StringBuffer retval = new StringBuffer();
- char ch;
- for (int i = 0; i < str.length(); i++) {
- switch (str.charAt(i))
- {
- case 0 :
- continue;
- case '\b':
- retval.append("\\b");
- continue;
- case '\t':
- retval.append("\\t");
- continue;
- case '\n':
- retval.append("\\n");
- continue;
- case '\f':
- retval.append("\\f");
- continue;
- case '\r':
- retval.append("\\r");
- continue;
- case '\"':
- retval.append("\\\"");
- continue;
- case '\'':
- retval.append("\\\'");
- continue;
- case '\\':
- retval.append("\\\\");
- continue;
- default:
- if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
- String s = "0000" + Integer.toString(ch, 16);
- retval.append("\\u" + s.substring(s.length() - 4,
s.length()));
- } else {
- retval.append(ch);
- }
- continue;
- }
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
+
+ /**
+ * Replaces unprintable characters by their escaped (or unicode escaped)
+ * equivalents in the given string
+ */
+ protected static final String addEscapes(String str) {
+ StringBuffer retval = new StringBuffer();
+ char ch;
+ for (int i = 0; i < str.length(); i++) {
+ switch (str.charAt(i))
+ {
+ case 0 :
+ continue;
+ case '\b':
+ retval.append("\\b");
+ continue;
+ case '\t':
+ retval.append("\\t");
+ continue;
+ case '\n':
+ retval.append("\\n");
+ continue;
+ case '\f':
+ retval.append("\\f");
+ continue;
+ case '\r':
+ retval.append("\\r");
+ continue;
+ case '\"':
+ retval.append("\\\"");
+ continue;
+ case '\'':
+ retval.append("\\\'");
+ continue;
+ case '\\':
+ retval.append("\\\\");
+ continue;
+ default:
+ if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+ String s = "0000" + Integer.toString(ch, 16);
+ retval.append("\\u" + s.substring(s.length() - 4, s.length()));
+ } else {
+ retval.append(ch);
+ }
+ continue;
}
- return retval.toString();
- }
+ }
+ return retval.toString();
+ }
- /**
- * Returns a detailed message for the Error when it is thrown by the
- * token manager to indicate a lexical error.
- * Parameters :
- * EOFSeen : indicates if EOF caused the lexical error
- * curLexState : lexical state in which this error occurred
- * errorLine : line number when the error occurred
- * errorColumn : column number when the error occurred
- * errorAfter : prefix that was seen before this error occurred
- * curchar : the offending character
- * Note: You can customize the lexical error message by modifying this method.
- */
- protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int
errorColumn, String errorAfter, char curChar) {
- return("Lexical error at line " +
- errorLine + ", column " +
- errorColumn + ". Encountered: " +
- (EOFSeen ? "<EOF> " : ("\"" +
addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar
+ "), ") +
- "after : \"" + addEscapes(errorAfter) + "\"");
- }
+ /**
+ * Returns a detailed message for the Error when it is thrown by the
+ * token manager to indicate a lexical error.
+ * Parameters :
+ * EOFSeen : indicates if EOF caused the lexical error
+ * curLexState : lexical state in which this error occurred
+ * errorLine : line number when the error occurred
+ * errorColumn : column number when the error occurred
+ * errorAfter : prefix that was seen before this error occurred
+ * curchar : the offending character
+ * Note: You can customize the lexical error message by modifying this method.
+ */
+ protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int
errorColumn, String errorAfter, char curChar) {
+ return("Lexical error at line " +
+ errorLine + ", column " +
+ errorColumn + ". Encountered: " +
+ (EOFSeen ? "<EOF> " : ("\"" +
addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar
+ "), ") +
+ "after : \"" + addEscapes(errorAfter) + "\"");
+ }
- /**
- * You can also modify the body of this method to customize your error messages.
- * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
- * of end-users concern, so you can return something like :
- *
- * "Internal Error : Please file a bug report .... "
- *
- * from this method for such cases in the release version of your parser.
- */
- public String getMessage() {
- return super.getMessage();
- }
+ /**
+ * You can also modify the body of this method to customize your error messages.
+ * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
+ * of end-users concern, so you can return something like :
+ *
+ * "Internal Error : Please file a bug report .... "
+ *
+ * from this method for such cases in the release version of your parser.
+ */
+ public String getMessage() {
+ return super.getMessage();
+ }
- /*
- * Constructors of various flavors follow.
- */
+ /*
+ * Constructors of various flavors follow.
+ */
- /** No arg constructor. */
- public TokenMgrError() {
- }
+ /** No arg constructor. */
+ public TokenMgrError() {
+ }
- /** Constructor with message and reason. */
- public TokenMgrError(String message, int reason) {
- super(message);
- errorCode = reason;
- }
+ /** Constructor with message and reason. */
+ public TokenMgrError(String message, int reason) {
+ super(message);
+ errorCode = reason;
+ }
- /** Full Constructor. */
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn,
String errorAfter, char curChar, int reason) {
- this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar),
reason);
- }
+ /** Full Constructor. */
+ public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn,
String errorAfter, char curChar, int reason) {
+ this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar),
reason);
+ }
}
-/* JavaCC - OriginalChecksum=6b523b4a5c49e1ee9e58afea685a63ce (do not edit this line) */
+/* JavaCC - OriginalChecksum=de3ff0bacfb0fe749cc8eaf56ae82fea (do not edit this line) */
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-08-27 11:54:53 UTC (rev 1546)
+++ trunk/webapps/docs/changelog.xml 2010-08-31 16:35:24 UTC (rev 1547)
@@ -64,6 +64,13 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <jboss-jira>JBAS-8374</jboss-jira>: Allow empty parameters brackets
for EL method calls. (remm)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 3.0.0.Beta6 (remm)">