JBossWeb SVN: r1547 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
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)">
14 years, 3 months
JBossWeb SVN: r1546 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-08-27 07:54:53 -0400 (Fri, 27 Aug 2010)
New Revision: 1546
Modified:
trunk/java/org/apache/catalina/connector/Request.java
trunk/webapps/docs/changelog.xml
Log:
- Port a patch: add back a fix I had reverted years ago.
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2010-08-26 15:15:51 UTC (rev 1545)
+++ trunk/java/org/apache/catalina/connector/Request.java 2010-08-27 11:54:53 UTC (rev 1546)
@@ -2178,12 +2178,7 @@
* Return the query string associated with this request.
*/
public String getQueryString() {
- String queryString = coyoteRequest.queryString().toString();
- if (queryString == null || queryString.equals("")) {
- return (null);
- } else {
- return queryString;
- }
+ return coyoteRequest.queryString().toString();
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-08-26 15:15:51 UTC (rev 1545)
+++ trunk/webapps/docs/changelog.xml 2010-08-27 11:54:53 UTC (rev 1546)
@@ -48,6 +48,10 @@
<bug>49428</bug>: Specify a namespace rather than use a default to please MS clients.
Submitted by Panagiotis Astithas. (markt)
</fix>
+ <fix>
+ <bug>38113</bug>: Empty query Strings should be acceptable. This may be incompatible with
+ some old non compliant applications. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
14 years, 4 months
JBossWeb SVN: r1545 - trunk/java/org/apache/catalina/core.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-08-26 11:15:51 -0400 (Thu, 26 Aug 2010)
New Revision: 1545
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
Log:
- Add a null check to make JF happy.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2010-08-26 09:46:12 UTC (rev 1544)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2010-08-26 15:15:51 UTC (rev 1545)
@@ -4202,7 +4202,7 @@
if (getResources() == null)
return oldContextClassLoader;
- if (getLoader().getClassLoader() != null) {
+ if ((getLoader() != null) && getLoader().getClassLoader() != null) {
Thread.currentThread().setContextClassLoader
(getLoader().getClassLoader());
}
14 years, 4 months
JBossWeb SVN: r1544 - trunk.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-08-26 05:46:12 -0400 (Thu, 26 Aug 2010)
New Revision: 1544
Modified:
trunk/build.xml
Log:
- Update maven stuff for src. (try to, at least)
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2010-08-26 09:45:16 UTC (rev 1543)
+++ trunk/build.xml 2010-08-26 09:46:12 UTC (rev 1544)
@@ -350,14 +350,14 @@
<copy file="${jasper-jdt.jar}" todir="${tomcat.jars}" />
<!-- Create a source jar of the jbossweb/servlet classes -->
- <zip destfile="${tomcat.jars}/jbossweb-src.zip">
+ <jar destfile="${tomcat.jars}/jbossweb-src.jar" index="true">
<fileset dir="${basedir}/java">
<include name="org/**" />
<exclude name="org/jboss/logging/**" />
<exclude name="javax/servlet/**" />
<exclude name="javax/el/**" />
</fileset>
- </zip>
+ </jar>
</target>
@@ -504,7 +504,7 @@
</exec>
<exec dir="." executable="/bin/sh" os="Linux">
<arg value="-c" />
- <arg value="mvn deploy:deploy-file -Dfile=${tomcat.jars}/jbossweb-src.zip -Durl=${maven.repository.url} -Dpackaging=jar -DrepositoryId=${maven.repository.id} -DgroupId=jboss.web -DartifactId=jbossweb -Dversion=${version} -Dclassifier=sources"/>
+ <arg value="mvn deploy:deploy-file -Dfile=${tomcat.jars}/jbossweb-src.jar -Durl=${maven.repository.url} -Dpackaging=jar -DrepositoryId=${maven.repository.id} -DgroupId=org.jboss.web -DartifactId=jbossweb-src -Dversion=${version} -Dclassifier=sources"/>
</exec>
<!-- Windows exec -->
@@ -518,7 +518,7 @@
</exec>
<exec dir="." executable="cmd" os="Windows NT">
<arg value="/c" />
- <arg value="mvn deploy:deploy-file -Dfile=${tomcat.jars}/jbossweb-src.zip -Durl=${maven.repository.url} -Dpackaging=jar -DrepositoryId=${maven.repository.id} -DgroupId=jboss.web -DartifactId=jbossweb -Dversion=${version} -Dclassifier=sources"/>
+ <arg value="mvn deploy:deploy-file -Dfile=${tomcat.jars}/jbossweb-src.jar -Durl=${maven.repository.url} -Dpackaging=jar -DrepositoryId=${maven.repository.id} -DgroupId=org.jboss.web -DartifactId=jbossweb-src -Dversion=${version} -Dclassifier=sources"/>
</exec>
</target>
14 years, 4 months
JBossWeb SVN: r1543 - trunk/java/org/apache/catalina/startup.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-08-26 05:45:16 -0400 (Thu, 26 Aug 2010)
New Revision: 1543
Modified:
trunk/java/org/apache/catalina/startup/HostConfig.java
Log:
- Drop useless stuff which could cause some NPEs from HostConfig.
Modified: trunk/java/org/apache/catalina/startup/HostConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/HostConfig.java 2010-08-25 13:00:37 UTC (rev 1542)
+++ trunk/java/org/apache/catalina/startup/HostConfig.java 2010-08-26 09:45:16 UTC (rev 1543)
@@ -85,12 +85,6 @@
/**
- * The JMX ObjectName of this component.
- */
- protected ObjectName oname = null;
-
-
- /**
* The string resources for this package.
*/
protected static final StringManager sm =
@@ -104,12 +98,6 @@
protected ArrayList<String> serviced = new ArrayList<String>();
- /**
- * The list of Wars in the appBase to be ignored because they are invalid
- * (e.g. contain /../ sequences).
- */
- protected Set<String> invalidWars = new HashSet<String>();
-
// ------------------------------------------------------------- Properties
@@ -167,6 +155,14 @@
*/
public void lifecycleEvent(LifecycleEvent event) {
+ // Identify the context we are associated with
+ try {
+ host = (Host) event.getLifecycle();
+ } catch (ClassCastException e) {
+ log.error(sm.getString("hostConfig.cce", event.getLifecycle()), e);
+ return;
+ }
+
if (event.getType().equals(Lifecycle.PERIODIC_EVENT))
check();
@@ -275,16 +271,6 @@
if (log.isDebugEnabled())
log.debug(sm.getString("hostConfig.start"));
- try {
- ObjectName hostON = new ObjectName(host.getObjectName());
- oname = new ObjectName
- (hostON.getDomain() + ":type=Deployer,host=" + host.getName());
- Registry.getRegistry(null, null).registerComponent
- (this, oname, this.getClass().getName());
- } catch (Exception e) {
- log.error(sm.getString("hostConfig.jmx.register", oname), e);
- }
-
}
@@ -298,14 +284,6 @@
undeployApps();
- if (oname != null) {
- try {
- Registry.getRegistry(null, null).unregisterComponent(oname);
- } catch (Exception e) {
- log.error(sm.getString("hostConfig.jmx.unregister", oname), e);
- }
- }
- oname = null;
appBase = null;
configBase = null;
14 years, 4 months
JBossWeb SVN: r1542 - trunk/java/org/apache/catalina/authenticator.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-08-25 09:00:37 -0400 (Wed, 25 Aug 2010)
New Revision: 1542
Modified:
trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
Log:
- Add SSO HttpOnly. The SSO valve could use a full SessionCookie config, but this would need custom config.
Not nice.
Modified: trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java 2010-08-24 14:29:16 UTC (rev 1541)
+++ trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java 2010-08-25 13:00:37 UTC (rev 1542)
@@ -821,6 +821,10 @@
// Bugzilla 41217
cookie.setSecure(request.isSecure());
+ if (sso.isCookieHttpOnly()) {
+ cookie.setHttpOnly(true);
+ }
+
// Bugzilla 34724
String ssoDomain = sso.getCookieDomain();
if(ssoDomain != null) {
Modified: trunk/java/org/apache/catalina/authenticator/SingleSignOn.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/SingleSignOn.java 2010-08-24 14:29:16 UTC (rev 1541)
+++ trunk/java/org/apache/catalina/authenticator/SingleSignOn.java 2010-08-25 13:00:37 UTC (rev 1542)
@@ -121,8 +121,21 @@
*/
protected String cookieDomain;
+ /**
+ * Optional SSO HTTP only.
+ */
+ protected boolean cookieHttpOnly = false;
+
// ------------------------------------------------------------- Properties
+ public boolean isCookieHttpOnly() {
+ return cookieHttpOnly;
+ }
+
+ public void setCookieHttpOnly(boolean cookieHttpOnly) {
+ this.cookieHttpOnly = cookieHttpOnly;
+ }
+
/**
* Returns the optional cookie domain.
* May return null.
@@ -132,6 +145,7 @@
public String getCookieDomain() {
return cookieDomain;
}
+
/**
* Sets the domain to be used for sso cookies.
*
14 years, 4 months
JBossWeb SVN: r1541 - branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2010-08-24 10:29:16 -0400 (Tue, 24 Aug 2010)
New Revision: 1541
Modified:
branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java
Log:
Fix for JBPAPP-2039.
Modified: branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2010-08-20 15:16:04 UTC (rev 1540)
+++ branches/JBOSSWEB_2_0_0_GA_CP/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2010-08-24 14:29:16 UTC (rev 1541)
@@ -60,14 +60,21 @@
'\t':9 ' ':32 '\"':34 '\'':39 '(':40 ')':41 ',':44 ':':58 ';':59 '<':60
'=':61 '>':62 '?':63 '@':64 '[':91 '\\':92 ']':93 '{':123 '}':125
*/
- public static final char SEPARATORS[] = { '\t', ' ', '\"', '\'', '(', ')', ',',
- ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '{', '}' };
+ public static final char SEPARATORS[];
protected static final boolean separators[] = new boolean[128];
static {
for (int i = 0; i < 128; i++) {
separators[i] = false;
}
+ if (Boolean.valueOf(System.getProperty("org.apache.tomcat.util.http.ServerCookie.VERSION_SWITCH", "false")).booleanValue()) {
+ /* Version 1 separators */
+ SEPARATORS = new char[] { '\t', ' ', '\"', '\'', '(', ')', ',',
+ ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '{', '}' };
+ } else {
+ /* Version 0 separators */
+ SEPARATORS = new char[] { ',', ';', ' ', '\t', '='};
+ }
for (int i = 0; i < SEPARATORS.length; i++) {
separators[SEPARATORS[i]] = true;
}
14 years, 4 months
JBossWeb SVN: r1540 - branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2010-08-20 11:16:04 -0400 (Fri, 20 Aug 2010)
New Revision: 1540
Modified:
branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java
Log:
Fix session attribute NullPointerException for [JBPAPP-4921].
Modified: branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java 2010-08-20 15:02:11 UTC (rev 1539)
+++ branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/src/share/classes/org/apache/catalina/session/StandardSession.java 2010-08-20 15:16:04 UTC (rev 1540)
@@ -1032,6 +1032,10 @@
throw new IllegalStateException
(sm.getString("standardSession.getAttribute.ise"));
+ if (name == null) {
+ return null;
+ }
+
return (attributes.get(name));
}
@@ -1634,6 +1638,9 @@
*/
protected void removeAttributeInternal(String name, boolean notify) {
+ // Avoid NPE
+ if (name == null) return;
+
// Remove this attribute from our collection
Object value = attributes.remove(name);
14 years, 4 months
JBossWeb SVN: r1539 - branches.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2010-08-20 11:02:11 -0400 (Fri, 20 Aug 2010)
New Revision: 1539
Added:
branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921/
Log:
Create JBPAPP-4921 patch branch from JBOSSWEB_2_0_0_GA_CP13 tag
Copied: branches/JBOSSWEB_2_0_0_GA_CP13_JBPAPP-4921 (from rev 1538, tags/JBOSSWEB_2_0_0_GA_CP13)
14 years, 4 months
JBossWeb SVN: r1538 - branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector.
by jbossweb-commits@lists.jboss.org
Author: mmillson
Date: 2010-08-20 10:42:26 -0400 (Fri, 20 Aug 2010)
New Revision: 1538
Modified:
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/LocalStrings.properties
branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java
Log:
Fix retrieving request parameters on POST with transfer-encoding: chunked for [JBPAPP-4788].
Modified: branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/LocalStrings.properties
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/LocalStrings.properties 2010-08-18 16:27:58 UTC (rev 1537)
+++ branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/LocalStrings.properties 2010-08-20 14:42:26 UTC (rev 1538)
@@ -48,6 +48,7 @@
coyoteRequest.attributeEvent=Exception thrown by attributes event listener
coyoteRequest.parseParameters=Exception thrown whilst processing POSTed parameters
coyoteRequest.postTooLarge=Parameters were not parsed because the size of the posted data was too big. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
+coyoteRequest.chunkedPostTooLarge=Parameters were not parsed because the size of the posted data was too big. Because this request was a chunked request, it could not be processed further. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
requestFacade.nullRequest=Null request object
responseFacade.nullResponse=Null response object
Modified: branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java 2010-08-18 16:27:58 UTC (rev 1537)
+++ branches/JBOSSWEB_2_0_0_GA_CP12_JBPAPP-4788/src/share/classes/org/apache/catalina/connector/Request.java 2010-08-20 14:42:26 UTC (rev 1538)
@@ -46,6 +46,7 @@
import javax.servlet.http.HttpSession;
import org.apache.tomcat.util.buf.B2CConverter;
+import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.buf.StringCache;
import org.apache.tomcat.util.http.Cookies;
@@ -2455,7 +2456,8 @@
int maxPostSize = connector.getMaxPostSize();
if ((maxPostSize > 0) && (len > maxPostSize)) {
if (context.getLogger().isDebugEnabled()) {
- context.getLogger().debug("Post too large");
+ context.getLogger().debug(
+ sm.getString("coyoteRequest.postTooLarge"));
}
return;
}
@@ -2480,6 +2482,20 @@
return;
}
parameters.processParameters(formData, 0, len);
+ } else if ("chunked".equalsIgnoreCase(
+ coyoteRequest.getHeader("transfer-encoding"))) {
+ byte[] formData = null;
+ try {
+ formData = readChunkedPostBody();
+ } catch (IOException e) {
+ // Client disconnect
+ if (context.getLogger().isDebugEnabled()) {
+ context.getLogger().debug(
+ sm.getString("coyoteRequest.parseParameters"), e);
+ }
+ return;
+ }
+ parameters.processParameters(formData, 0, formData.length);
}
}
@@ -2505,6 +2521,38 @@
/**
+ * Read chunked post body.
+ */
+ protected byte[] readChunkedPostBody() throws IOException {
+ ByteChunk body = new ByteChunk();
+
+ byte[] buffer = new byte[CACHED_POST_LEN];
+
+ int len = 0;
+ while (len > -1) {
+ len = getStream().read(buffer, 0, CACHED_POST_LEN);
+ if (connector.getMaxPostSize() > 0 &&
+ (body.getLength() + len) > connector.getMaxPostSize()) {
+ // Too much data
+ throw new IllegalArgumentException(
+ sm.getString("coyoteRequest.chunkedPostTooLarge"));
+ }
+ if (len > 0) {
+ body.append(buffer, 0, len);
+ }
+ }
+ if (body.getLength() < body.getBuffer().length) {
+ int length = body.getLength();
+ byte[] result = new byte[length];
+ System.arraycopy(body.getBuffer(), 0, result, 0, length);
+ return result;
+ } else {
+ return body.getBuffer();
+ }
+ }
+
+
+ /**
* Parse request locales.
*/
protected void parseLocales() {
14 years, 4 months