JBossWeb SVN: r1355 - in trunk: java/org/apache/el/lang and 4 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-14 09:48:10 -0500 (Thu, 14 Jan 2010)
New Revision: 1355
Added:
trunk/java/org/apache/jasper/compiler/AttributeParser.java
Modified:
trunk/java/org/apache/el/MethodExpressionImpl.java
trunk/java/org/apache/el/lang/ELSupport.java
trunk/java/org/apache/el/parser/AstLiteralExpression.java
trunk/java/org/apache/el/parser/AstString.java
trunk/java/org/apache/el/parser/AstValue.java
trunk/java/org/apache/el/parser/ELParser.java
trunk/java/org/apache/el/parser/ELParser.jjt
trunk/java/org/apache/el/parser/ELParserConstants.java
trunk/java/org/apache/el/parser/ELParserTokenManager.java
trunk/java/org/apache/el/parser/Node.java
trunk/java/org/apache/el/parser/ParseException.java
trunk/java/org/apache/el/parser/SimpleNode.java
trunk/java/org/apache/el/parser/TokenMgrError.java
trunk/java/org/apache/jasper/compiler/ELParser.java
trunk/java/org/apache/jasper/compiler/Generator.java
trunk/java/org/apache/jasper/compiler/Parser.java
trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
trunk/webapps/docs/changelog.xml
Log:
- Sync with Tomcat's EL escaping fixes.
- Add a missing method implementation in EL.
Modified: trunk/java/org/apache/el/MethodExpressionImpl.java
===================================================================
--- trunk/java/org/apache/el/MethodExpressionImpl.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/MethodExpressionImpl.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -311,4 +311,9 @@
public boolean isLiteralText() {
return false;
}
+
+ public boolean isParametersProvided() {
+ return this.getNode().isParametersProvided();
+ }
+
}
Modified: trunk/java/org/apache/el/lang/ELSupport.java
===================================================================
--- trunk/java/org/apache/el/lang/ELSupport.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/lang/ELSupport.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -251,6 +251,9 @@
if (Float.TYPE == type || Float.class.equals(type)) {
return new Float(number.floatValue());
}
+ if (Number.class.equals(type)) {
+ return number;
+ }
throw new ELException(MessageFactory.get("error.convert",
number, number.getClass(), type));
Modified: trunk/java/org/apache/el/parser/AstLiteralExpression.java
===================================================================
--- trunk/java/org/apache/el/parser/AstLiteralExpression.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/AstLiteralExpression.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -49,10 +49,10 @@
StringBuilder buf = new StringBuilder(size);
for (int i = 0; i < size; i++) {
char c = image.charAt(i);
- if (c == '\\' && i + 1 < size) {
+ if (c == '\\' && i + 2 < size) {
char c1 = image.charAt(i + 1);
- if (c1 == '\\' || c1 == '"' || c1 == '\'' || c1 == '#'
- || c1 == '$') {
+ char c2 = image.charAt(i + 2);
+ if ((c1 == '#' || c1 == '$') && c2 == '{') {
c = c1;
i++;
}
Modified: trunk/java/org/apache/el/parser/AstString.java
===================================================================
--- trunk/java/org/apache/el/parser/AstString.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/AstString.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -62,8 +62,7 @@
char c = image.charAt(i);
if (c == '\\' && i + 1 < size) {
char c1 = image.charAt(i + 1);
- if (c1 == '\\' || c1 == '"' || c1 == '\'' || c1 == '#'
- || c1 == '$') {
+ if (c1 == '\\' || c1 == '"' || c1 == '\'') {
c = c1;
i++;
}
Modified: trunk/java/org/apache/el/parser/AstValue.java
===================================================================
--- trunk/java/org/apache/el/parser/AstValue.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/AstValue.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -202,4 +202,13 @@
}
return result;
}
+
+ public boolean isParametersProvided() {
+ if (jjtGetNumChildren() > 1 && this.children[1] != null &&
+ this.children[1] instanceof AstDotSuffix) {
+ return (this.children[1].jjtGetNumChildren()) > 0;
+ }
+ return false;
+ }
+
}
Modified: trunk/java/org/apache/el/parser/ELParser.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParser.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/ELParser.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -1447,30 +1447,6 @@
finally { jj_save(2, xla); }
}
- private boolean jj_3_2() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_13()) jj_scanpos = xsp;
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(LPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_69() {
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_25() {
- if (jj_3R_31()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_32()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
private boolean jj_3R_59() {
if (jj_3R_69()) return true;
return false;
@@ -1538,9 +1514,9 @@
private boolean jj_3R_30() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(29)) {
+ if (jj_scan_token(27)) {
jj_scanpos = xsp;
- if (jj_scan_token(30)) return true;
+ if (jj_scan_token(28)) return true;
}
return false;
}
@@ -1553,9 +1529,9 @@
private boolean jj_3R_29() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(31)) {
+ if (jj_scan_token(29)) {
jj_scanpos = xsp;
- if (jj_scan_token(32)) return true;
+ if (jj_scan_token(30)) return true;
}
return false;
}
@@ -1563,9 +1539,9 @@
private boolean jj_3R_28() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(25)) {
+ if (jj_scan_token(23)) {
jj_scanpos = xsp;
- if (jj_scan_token(26)) return true;
+ if (jj_scan_token(24)) return true;
}
return false;
}
@@ -1589,9 +1565,9 @@
private boolean jj_3R_27() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(27)) {
+ if (jj_scan_token(25)) {
jj_scanpos = xsp;
- if (jj_scan_token(28)) return true;
+ if (jj_scan_token(26)) return true;
}
return false;
}
@@ -1629,9 +1605,9 @@
private boolean jj_3R_24() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(35)) {
+ if (jj_scan_token(33)) {
jj_scanpos = xsp;
- if (jj_scan_token(36)) return true;
+ if (jj_scan_token(34)) return true;
}
return false;
}
@@ -1644,9 +1620,9 @@
private boolean jj_3R_23() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(33)) {
+ if (jj_scan_token(31)) {
jj_scanpos = xsp;
- if (jj_scan_token(34)) return true;
+ if (jj_scan_token(32)) return true;
}
return false;
}
@@ -1664,9 +1640,9 @@
private boolean jj_3R_18() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(39)) {
+ if (jj_scan_token(37)) {
jj_scanpos = xsp;
- if (jj_scan_token(40)) return true;
+ if (jj_scan_token(38)) return true;
}
return false;
}
@@ -1764,9 +1740,9 @@
private boolean jj_3R_16() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(41)) {
+ if (jj_scan_token(39)) {
jj_scanpos = xsp;
- if (jj_scan_token(42)) return true;
+ if (jj_scan_token(40)) return true;
}
return false;
}
@@ -1856,9 +1832,9 @@
private boolean jj_3R_36() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(37)) {
+ if (jj_scan_token(35)) {
jj_scanpos = xsp;
- if (jj_scan_token(38)) return true;
+ if (jj_scan_token(36)) return true;
}
if (jj_3R_31()) return true;
return false;
@@ -1909,9 +1885,9 @@
private boolean jj_3R_41() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(51)) {
+ if (jj_scan_token(49)) {
jj_scanpos = xsp;
- if (jj_scan_token(52)) return true;
+ if (jj_scan_token(50)) return true;
}
return false;
}
@@ -1919,9 +1895,9 @@
private boolean jj_3R_40() {
Token xsp;
xsp = jj_scanpos;
- if (jj_scan_token(49)) {
+ if (jj_scan_token(47)) {
jj_scanpos = xsp;
- if (jj_scan_token(50)) return true;
+ if (jj_scan_token(48)) return true;
}
return false;
}
@@ -1950,6 +1926,30 @@
return false;
}
+ private boolean jj_3_2() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_13()) jj_scanpos = xsp;
+ if (jj_scan_token(IDENTIFIER)) return true;
+ if (jj_scan_token(LPAREN)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_69() {
+ if (jj_scan_token(IDENTIFIER)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_25() {
+ if (jj_3R_31()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_32()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
/** Generated Token Manager. */
public ELParserTokenManager token_source;
SimpleCharStream jj_input_stream;
@@ -1969,10 +1969,10 @@
jj_la1_init_1();
}
private static void jj_la1_init_0() {
- jj_la1_0 = new int[] {0xe,0xe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xfe000000,0x18000000,0x6000000,0x80000000,0x60000000,0xfe000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x9d600,0x240000,0x9d600,0x240000,0x80000,0x80000,0x1000000,0x80000,0x0,0x1000000,0x9d600,0x1d600,0xc000,};
+ 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,};
}
private static void jj_la1_init_1() {
- jj_la1_1 = new int[] {0x0,0x0,0x600,0x600,0x180,0x180,0x1e,0x6,0x18,0x1e,0x1,0x0,0x0,0x1,0x0,0x1,0xc000,0xc000,0x1e2000,0x60000,0x180000,0x1e2000,0x60,0x208860,0x0,0x200000,0x0,0x0,0x0,0x0,0x0,0x200000,0x0,0x208860,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,0x0,0x0,0x80000,0x0,0x82218,0x0,0x0,};
}
final private JJCalls[] jj_2_rtns = new JJCalls[3];
private boolean jj_rescan = false;
@@ -2161,7 +2161,7 @@
/** Generate ParseException. */
public ParseException generateParseException() {
jj_expentries.clear();
- boolean[] la1tokens = new boolean[59];
+ boolean[] la1tokens = new boolean[57];
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
@@ -2178,7 +2178,7 @@
}
}
}
- for (int i = 0; i < 59; i++) {
+ for (int i = 0; i < 57; i++) {
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
Modified: trunk/java/org/apache/el/parser/ELParser.jjt
===================================================================
--- trunk/java/org/apache/el/parser/ELParser.jjt 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/ELParser.jjt 2010-01-14 14:48:10 UTC (rev 1355)
@@ -367,11 +367,15 @@
/* ==================================================================================== */
<DEFAULT> TOKEN :
{
+ /*
+ * The following definition uses + rather than * in two places to prevent
+ * LITERAL_EXPRESSION matching the empty string that could result in the
+ * Parser entering an infinite loop.
+ */
< LITERAL_EXPRESSION:
- ((~["\\", "$", "#"])
- | ("\\" ("\\" | "$" | "#"))
- | ("$" ~["{", "$"])
- | ("#" ~["{", "#"])
+ ( (~["$", "#", "\\"])* "\\" (["$", "#"])?
+ | (~["$", "#"])* (["$", "#"] ~["{"])
+ | (~["$", "#"])+
)+
| "$"
| "#"
@@ -382,8 +386,6 @@
< START_DEFERRED_EXPRESSION: "#{" > : IN_EXPRESSION
}
-<DEFAULT> SKIP : { "\\" }
-
<IN_EXPRESSION> SKIP : { " " | "\t" | "\n" | "\r" }
<IN_EXPRESSION> TOKEN :
@@ -395,13 +397,10 @@
>
| < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
| < STRING_LITERAL: ("\"" ((~["\"","\\"])
- | ("\\" ( ["\\","\""] )))* "\"")
+ | ("\\" ( ["\\","\"","\'"] )))* "\"")
| ("\'" ((~["\'","\\"])
- | ("\\" ( ["\\","\'"] )))* "\'")
+ | ("\\" ( ["\\","\"","\'"] )))* "\'")
>
-| < BADLY_ESCAPED_STRING_LITERAL: ("\"" (~["\"","\\"])* ("\\" ( ~["\\","\""] )))
- | ("\'" (~["\'","\\"])* ("\\" ( ~["\\","\'"] )))
- >
| < TRUE : "true" >
| < FALSE : "false" >
| < NULL : "null" >
Modified: trunk/java/org/apache/el/parser/ELParserConstants.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParserConstants.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/ELParserConstants.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -17,105 +17,103 @@
/** RegularExpression Id. */
int START_DEFERRED_EXPRESSION = 3;
/** RegularExpression Id. */
- int INTEGER_LITERAL = 9;
+ int INTEGER_LITERAL = 8;
/** RegularExpression Id. */
- int FLOATING_POINT_LITERAL = 10;
+ int FLOATING_POINT_LITERAL = 9;
/** RegularExpression Id. */
- int EXPONENT = 11;
+ int EXPONENT = 10;
/** RegularExpression Id. */
- int STRING_LITERAL = 12;
+ int STRING_LITERAL = 11;
/** RegularExpression Id. */
- int BADLY_ESCAPED_STRING_LITERAL = 13;
+ int TRUE = 12;
/** RegularExpression Id. */
- int TRUE = 14;
+ int FALSE = 13;
/** RegularExpression Id. */
- int FALSE = 15;
+ int NULL = 14;
/** RegularExpression Id. */
- int NULL = 16;
+ int END_EXPRESSION = 15;
/** RegularExpression Id. */
- int END_EXPRESSION = 17;
+ int DOT = 16;
/** RegularExpression Id. */
- int DOT = 18;
+ int LPAREN = 17;
/** RegularExpression Id. */
- int LPAREN = 19;
+ int RPAREN = 18;
/** RegularExpression Id. */
- int RPAREN = 20;
+ int LBRACK = 19;
/** RegularExpression Id. */
- int LBRACK = 21;
+ int RBRACK = 20;
/** RegularExpression Id. */
- int RBRACK = 22;
+ int COLON = 21;
/** RegularExpression Id. */
- int COLON = 23;
+ int COMMA = 22;
/** RegularExpression Id. */
- int COMMA = 24;
+ int GT0 = 23;
/** RegularExpression Id. */
- int GT0 = 25;
+ int GT1 = 24;
/** RegularExpression Id. */
- int GT1 = 26;
+ int LT0 = 25;
/** RegularExpression Id. */
- int LT0 = 27;
+ int LT1 = 26;
/** RegularExpression Id. */
- int LT1 = 28;
+ int GE0 = 27;
/** RegularExpression Id. */
- int GE0 = 29;
+ int GE1 = 28;
/** RegularExpression Id. */
- int GE1 = 30;
+ int LE0 = 29;
/** RegularExpression Id. */
- int LE0 = 31;
+ int LE1 = 30;
/** RegularExpression Id. */
- int LE1 = 32;
+ int EQ0 = 31;
/** RegularExpression Id. */
- int EQ0 = 33;
+ int EQ1 = 32;
/** RegularExpression Id. */
- int EQ1 = 34;
+ int NE0 = 33;
/** RegularExpression Id. */
- int NE0 = 35;
+ int NE1 = 34;
/** RegularExpression Id. */
- int NE1 = 36;
+ int NOT0 = 35;
/** RegularExpression Id. */
- int NOT0 = 37;
+ int NOT1 = 36;
/** RegularExpression Id. */
- int NOT1 = 38;
+ int AND0 = 37;
/** RegularExpression Id. */
- int AND0 = 39;
+ int AND1 = 38;
/** RegularExpression Id. */
- int AND1 = 40;
+ int OR0 = 39;
/** RegularExpression Id. */
- int OR0 = 41;
+ int OR1 = 40;
/** RegularExpression Id. */
- int OR1 = 42;
+ int EMPTY = 41;
/** RegularExpression Id. */
- int EMPTY = 43;
+ int INSTANCEOF = 42;
/** RegularExpression Id. */
- int INSTANCEOF = 44;
+ int MULT = 43;
/** RegularExpression Id. */
- int MULT = 45;
+ int PLUS = 44;
/** RegularExpression Id. */
- int PLUS = 46;
+ int MINUS = 45;
/** RegularExpression Id. */
- int MINUS = 47;
+ int QUESTIONMARK = 46;
/** RegularExpression Id. */
- int QUESTIONMARK = 48;
+ int DIV0 = 47;
/** RegularExpression Id. */
- int DIV0 = 49;
+ int DIV1 = 48;
/** RegularExpression Id. */
- int DIV1 = 50;
+ int MOD0 = 49;
/** RegularExpression Id. */
- int MOD0 = 51;
+ int MOD1 = 50;
/** RegularExpression Id. */
- int MOD1 = 52;
+ int IDENTIFIER = 51;
/** RegularExpression Id. */
- int IDENTIFIER = 53;
+ int FUNCTIONSUFFIX = 52;
/** RegularExpression Id. */
- int FUNCTIONSUFFIX = 54;
+ int IMPL_OBJ_START = 53;
/** RegularExpression Id. */
- int IMPL_OBJ_START = 55;
+ int LETTER = 54;
/** RegularExpression Id. */
- int LETTER = 56;
+ int DIGIT = 55;
/** RegularExpression Id. */
- int DIGIT = 57;
- /** RegularExpression Id. */
- int ILLEGAL_CHARACTER = 58;
+ int ILLEGAL_CHARACTER = 56;
/** Lexical state. */
int DEFAULT = 0;
@@ -128,7 +126,6 @@
"<LITERAL_EXPRESSION>",
"\"${\"",
"\"#{\"",
- "\"\\\\\"",
"\" \"",
"\"\\t\"",
"\"\\n\"",
@@ -137,7 +134,6 @@
"<FLOATING_POINT_LITERAL>",
"<EXPONENT>",
"<STRING_LITERAL>",
- "<BADLY_ESCAPED_STRING_LITERAL>",
"\"true\"",
"\"false\"",
"\"null\"",
Modified: trunk/java/org/apache/el/parser/ELParserTokenManager.java
===================================================================
--- trunk/java/org/apache/el/parser/ELParserTokenManager.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/ELParserTokenManager.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -16,18 +16,11 @@
switch (pos)
{
case 0:
- if ((active0 & 0x10L) != 0L)
- return 2;
- if ((active0 & 0x4L) != 0L)
+ if ((active0 & 0xcL) != 0L)
{
jjmatchedKind = 1;
- return 4;
+ return 5;
}
- if ((active0 & 0x8L) != 0L)
- {
- jjmatchedKind = 1;
- return 6;
- }
return -1;
default :
return -1;
@@ -51,8 +44,6 @@
return jjMoveStringLiteralDfa1_0(0x8L);
case 36:
return jjMoveStringLiteralDfa1_0(0x4L);
- case 92:
- return jjStartNfaWithStates_0(0, 4, 2);
default :
return jjMoveNfa_0(7, 0);
}
@@ -77,14 +68,6 @@
}
return jjStartNfa_0(0, active0);
}
-private int jjStartNfaWithStates_0(int pos, int kind, int state)
-{
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { return pos + 1; }
- return jjMoveNfa_0(state, pos + 1);
-}
static final long[] jjbitVec0 = {
0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
};
@@ -114,53 +97,47 @@
{
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(0, 4);
}
else if ((0x1800000000L & l) != 0L)
{
if (kind > 1)
kind = 1;
+ jjCheckNAdd(5);
}
- if (curChar == 35)
- jjstateSet[jjnewStateCnt++] = 6;
- else if (curChar == 36)
- jjstateSet[jjnewStateCnt++] = 4;
+ if ((0xffffffe7ffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(0, 1);
break;
case 0:
- if ((0xffffffe7ffffffffL & l) == 0L)
- break;
- if (kind > 1)
- kind = 1;
- jjCheckNAddStates(0, 3);
+ if ((0xffffffe7ffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(0, 1);
break;
case 2:
- if ((0x1800000000L & l) == 0L)
+ if ((0xffffffe7ffffffffL & l) == 0L)
break;
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(0, 4);
break;
case 3:
- if (curChar == 36)
- jjstateSet[jjnewStateCnt++] = 4;
+ if ((0xffffffe7ffffffffL & l) != 0L)
+ jjCheckNAddTwoStates(3, 4);
break;
case 4:
- if ((0xffffffefffffffffL & l) == 0L)
- break;
+ if ((0x1800000000L & l) != 0L)
+ jjCheckNAdd(5);
+ break;
+ case 5:
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(5, 8);
break;
- case 5:
- if (curChar == 35)
- jjstateSet[jjnewStateCnt++] = 6;
- break;
case 6:
- if ((0xfffffff7ffffffffL & l) == 0L)
+ if ((0x1800000000L & l) == 0L)
break;
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(9, 13);
break;
default : break;
}
@@ -174,40 +151,43 @@
switch(jjstateSet[--i])
{
case 7:
+ if (kind > 1)
+ kind = 1;
+ jjCheckNAddStates(0, 4);
if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddTwoStates(0, 1);
+ else if (curChar == 92)
{
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(14, 17);
}
- else if (curChar == 92)
- jjstateSet[jjnewStateCnt++] = 2;
break;
case 0:
- if ((0xffffffffefffffffL & l) == 0L)
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddTwoStates(0, 1);
+ break;
+ case 1:
+ if (curChar != 92)
break;
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(14, 17);
break;
- case 1:
- if (curChar == 92)
- jjstateSet[jjnewStateCnt++] = 2;
- break;
case 2:
- if (curChar != 92)
- break;
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(0, 4);
break;
- case 4:
- case 6:
+ case 3:
+ jjCheckNAddTwoStates(3, 4);
+ break;
+ case 5:
if ((0xf7ffffffffffffffL & l) == 0L)
break;
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(5, 8);
break;
default : break;
}
@@ -225,15 +205,37 @@
switch(jjstateSet[--i])
{
case 7:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddTwoStates(0, 1);
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ {
+ if (kind > 1)
+ kind = 1;
+ jjCheckNAddStates(0, 4);
+ }
+ break;
case 0:
- case 4:
- case 6:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddTwoStates(0, 1);
+ break;
+ case 2:
if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
break;
if (kind > 1)
kind = 1;
- jjCheckNAddStates(0, 3);
+ jjCheckNAddStates(0, 4);
break;
+ case 3:
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjCheckNAddTwoStates(3, 4);
+ break;
+ case 5:
+ if (!jjCanMove_0(hiByte, i1, i2, l1, l2))
+ break;
+ if (kind > 1)
+ kind = 1;
+ jjCheckNAddStates(5, 8);
+ break;
default : break;
}
} while(i != startsAt);
@@ -256,84 +258,84 @@
switch (pos)
{
case 0:
- if ((active0 & 0x40000L) != 0L)
+ if ((active0 & 0x10000L) != 0L)
return 1;
- if ((active0 & 0x141d555401c000L) != 0L)
+ if ((active0 & 0x5075555007000L) != 0L)
{
- jjmatchedKind = 53;
- return 36;
+ jjmatchedKind = 51;
+ return 30;
}
return -1;
case 1:
- if ((active0 & 0x41554000000L) != 0L)
- return 36;
- if ((active0 & 0x1419400001c000L) != 0L)
+ if ((active0 & 0x5065000007000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 1;
- return 36;
+ return 30;
}
+ if ((active0 & 0x10555000000L) != 0L)
+ return 30;
return -1;
case 2:
- if ((active0 & 0x18000001c000L) != 0L)
+ if ((active0 & 0x5005000000000L) != 0L)
+ return 30;
+ if ((active0 & 0x60000007000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 2;
- return 36;
+ return 30;
}
- if ((active0 & 0x14014000000000L) != 0L)
- return 36;
return -1;
case 3:
- if ((active0 & 0x14000L) != 0L)
- return 36;
- if ((active0 & 0x180000008000L) != 0L)
+ if ((active0 & 0x5000L) != 0L)
+ return 30;
+ if ((active0 & 0x60000002000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 3;
- return 36;
+ return 30;
}
return -1;
case 4:
- if ((active0 & 0x80000008000L) != 0L)
- return 36;
- if ((active0 & 0x100000000000L) != 0L)
+ if ((active0 & 0x40000000000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 4;
- return 36;
+ return 30;
}
+ if ((active0 & 0x20000002000L) != 0L)
+ return 30;
return -1;
case 5:
- if ((active0 & 0x100000000000L) != 0L)
+ if ((active0 & 0x40000000000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 5;
- return 36;
+ return 30;
}
return -1;
case 6:
- if ((active0 & 0x100000000000L) != 0L)
+ if ((active0 & 0x40000000000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 6;
- return 36;
+ return 30;
}
return -1;
case 7:
- if ((active0 & 0x100000000000L) != 0L)
+ if ((active0 & 0x40000000000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 7;
- return 36;
+ return 30;
}
return -1;
case 8:
- if ((active0 & 0x100000000000L) != 0L)
+ if ((active0 & 0x40000000000L) != 0L)
{
- jjmatchedKind = 53;
+ jjmatchedKind = 51;
jjmatchedPos = 8;
- return 36;
+ return 30;
}
return -1;
default :
@@ -349,70 +351,70 @@
switch(curChar)
{
case 33:
- jjmatchedKind = 37;
- return jjMoveStringLiteralDfa1_1(0x800000000L);
+ jjmatchedKind = 35;
+ return jjMoveStringLiteralDfa1_1(0x200000000L);
case 37:
- return jjStopAtPos(0, 51);
+ return jjStopAtPos(0, 49);
case 38:
- return jjMoveStringLiteralDfa1_1(0x8000000000L);
+ return jjMoveStringLiteralDfa1_1(0x2000000000L);
case 40:
- return jjStopAtPos(0, 19);
+ return jjStopAtPos(0, 17);
case 41:
- return jjStopAtPos(0, 20);
+ return jjStopAtPos(0, 18);
case 42:
- return jjStopAtPos(0, 45);
+ return jjStopAtPos(0, 43);
case 43:
- return jjStopAtPos(0, 46);
+ return jjStopAtPos(0, 44);
case 44:
- return jjStopAtPos(0, 24);
+ return jjStopAtPos(0, 22);
case 45:
- return jjStopAtPos(0, 47);
+ return jjStopAtPos(0, 45);
case 46:
- return jjStartNfaWithStates_1(0, 18, 1);
+ return jjStartNfaWithStates_1(0, 16, 1);
case 47:
- return jjStopAtPos(0, 49);
+ return jjStopAtPos(0, 47);
case 58:
- return jjStopAtPos(0, 23);
+ return jjStopAtPos(0, 21);
case 60:
- jjmatchedKind = 27;
- return jjMoveStringLiteralDfa1_1(0x80000000L);
- case 61:
- return jjMoveStringLiteralDfa1_1(0x200000000L);
- case 62:
jjmatchedKind = 25;
return jjMoveStringLiteralDfa1_1(0x20000000L);
+ case 61:
+ return jjMoveStringLiteralDfa1_1(0x80000000L);
+ case 62:
+ jjmatchedKind = 23;
+ return jjMoveStringLiteralDfa1_1(0x8000000L);
case 63:
- return jjStopAtPos(0, 48);
+ return jjStopAtPos(0, 46);
case 91:
- return jjStopAtPos(0, 21);
+ return jjStopAtPos(0, 19);
case 93:
- return jjStopAtPos(0, 22);
+ return jjStopAtPos(0, 20);
case 97:
- return jjMoveStringLiteralDfa1_1(0x10000000000L);
+ return jjMoveStringLiteralDfa1_1(0x4000000000L);
case 100:
- return jjMoveStringLiteralDfa1_1(0x4000000000000L);
+ return jjMoveStringLiteralDfa1_1(0x1000000000000L);
case 101:
- return jjMoveStringLiteralDfa1_1(0x80400000000L);
+ return jjMoveStringLiteralDfa1_1(0x20100000000L);
case 102:
- return jjMoveStringLiteralDfa1_1(0x8000L);
+ return jjMoveStringLiteralDfa1_1(0x2000L);
case 103:
- return jjMoveStringLiteralDfa1_1(0x44000000L);
+ return jjMoveStringLiteralDfa1_1(0x11000000L);
case 105:
- return jjMoveStringLiteralDfa1_1(0x100000000000L);
+ return jjMoveStringLiteralDfa1_1(0x40000000000L);
case 108:
- return jjMoveStringLiteralDfa1_1(0x110000000L);
+ return jjMoveStringLiteralDfa1_1(0x44000000L);
case 109:
- return jjMoveStringLiteralDfa1_1(0x10000000000000L);
+ return jjMoveStringLiteralDfa1_1(0x4000000000000L);
case 110:
- return jjMoveStringLiteralDfa1_1(0x5000010000L);
+ return jjMoveStringLiteralDfa1_1(0x1400004000L);
case 111:
- return jjMoveStringLiteralDfa1_1(0x40000000000L);
+ return jjMoveStringLiteralDfa1_1(0x10000000000L);
case 116:
- return jjMoveStringLiteralDfa1_1(0x4000L);
+ return jjMoveStringLiteralDfa1_1(0x1000L);
case 124:
- return jjMoveStringLiteralDfa1_1(0x20000000000L);
+ return jjMoveStringLiteralDfa1_1(0x8000000000L);
case 125:
- return jjStopAtPos(0, 17);
+ return jjStopAtPos(0, 15);
default :
return jjMoveNfa_1(0, 0);
}
@@ -427,56 +429,56 @@
switch(curChar)
{
case 38:
- if ((active0 & 0x8000000000L) != 0L)
- return jjStopAtPos(1, 39);
+ if ((active0 & 0x2000000000L) != 0L)
+ return jjStopAtPos(1, 37);
break;
case 61:
- if ((active0 & 0x20000000L) != 0L)
+ if ((active0 & 0x8000000L) != 0L)
+ return jjStopAtPos(1, 27);
+ else if ((active0 & 0x20000000L) != 0L)
return jjStopAtPos(1, 29);
else if ((active0 & 0x80000000L) != 0L)
return jjStopAtPos(1, 31);
else if ((active0 & 0x200000000L) != 0L)
return jjStopAtPos(1, 33);
- else if ((active0 & 0x800000000L) != 0L)
- return jjStopAtPos(1, 35);
break;
case 97:
- return jjMoveStringLiteralDfa2_1(active0, 0x8000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x2000L);
case 101:
- if ((active0 & 0x40000000L) != 0L)
- return jjStartNfaWithStates_1(1, 30, 36);
- else if ((active0 & 0x100000000L) != 0L)
- return jjStartNfaWithStates_1(1, 32, 36);
- else if ((active0 & 0x1000000000L) != 0L)
- return jjStartNfaWithStates_1(1, 36, 36);
+ if ((active0 & 0x10000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 28, 30);
+ else if ((active0 & 0x40000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 30, 30);
+ else if ((active0 & 0x400000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 34, 30);
break;
case 105:
- return jjMoveStringLiteralDfa2_1(active0, 0x4000000000000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x1000000000000L);
case 109:
- return jjMoveStringLiteralDfa2_1(active0, 0x80000000000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x20000000000L);
case 110:
- return jjMoveStringLiteralDfa2_1(active0, 0x110000000000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x44000000000L);
case 111:
- return jjMoveStringLiteralDfa2_1(active0, 0x10004000000000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x4001000000000L);
case 113:
- if ((active0 & 0x400000000L) != 0L)
- return jjStartNfaWithStates_1(1, 34, 36);
+ if ((active0 & 0x100000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 32, 30);
break;
case 114:
- if ((active0 & 0x40000000000L) != 0L)
- return jjStartNfaWithStates_1(1, 42, 36);
- return jjMoveStringLiteralDfa2_1(active0, 0x4000L);
+ if ((active0 & 0x10000000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 40, 30);
+ return jjMoveStringLiteralDfa2_1(active0, 0x1000L);
case 116:
- if ((active0 & 0x4000000L) != 0L)
- return jjStartNfaWithStates_1(1, 26, 36);
- else if ((active0 & 0x10000000L) != 0L)
- return jjStartNfaWithStates_1(1, 28, 36);
+ if ((active0 & 0x1000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 24, 30);
+ else if ((active0 & 0x4000000L) != 0L)
+ return jjStartNfaWithStates_1(1, 26, 30);
break;
case 117:
- return jjMoveStringLiteralDfa2_1(active0, 0x10000L);
+ return jjMoveStringLiteralDfa2_1(active0, 0x4000L);
case 124:
- if ((active0 & 0x20000000000L) != 0L)
- return jjStopAtPos(1, 41);
+ if ((active0 & 0x8000000000L) != 0L)
+ return jjStopAtPos(1, 39);
break;
default :
break;
@@ -495,26 +497,26 @@
switch(curChar)
{
case 100:
- if ((active0 & 0x10000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 40, 36);
- else if ((active0 & 0x10000000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 52, 36);
+ if ((active0 & 0x4000000000L) != 0L)
+ return jjStartNfaWithStates_1(2, 38, 30);
+ else if ((active0 & 0x4000000000000L) != 0L)
+ return jjStartNfaWithStates_1(2, 50, 30);
break;
case 108:
- return jjMoveStringLiteralDfa3_1(active0, 0x18000L);
+ return jjMoveStringLiteralDfa3_1(active0, 0x6000L);
case 112:
- return jjMoveStringLiteralDfa3_1(active0, 0x80000000000L);
+ return jjMoveStringLiteralDfa3_1(active0, 0x20000000000L);
case 115:
- return jjMoveStringLiteralDfa3_1(active0, 0x100000000000L);
+ return jjMoveStringLiteralDfa3_1(active0, 0x40000000000L);
case 116:
- if ((active0 & 0x4000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 38, 36);
+ if ((active0 & 0x1000000000L) != 0L)
+ return jjStartNfaWithStates_1(2, 36, 30);
break;
case 117:
- return jjMoveStringLiteralDfa3_1(active0, 0x4000L);
+ return jjMoveStringLiteralDfa3_1(active0, 0x1000L);
case 118:
- if ((active0 & 0x4000000000000L) != 0L)
- return jjStartNfaWithStates_1(2, 50, 36);
+ if ((active0 & 0x1000000000000L) != 0L)
+ return jjStartNfaWithStates_1(2, 48, 30);
break;
default :
break;
@@ -533,17 +535,17 @@
switch(curChar)
{
case 101:
- if ((active0 & 0x4000L) != 0L)
- return jjStartNfaWithStates_1(3, 14, 36);
+ if ((active0 & 0x1000L) != 0L)
+ return jjStartNfaWithStates_1(3, 12, 30);
break;
case 108:
- if ((active0 & 0x10000L) != 0L)
- return jjStartNfaWithStates_1(3, 16, 36);
+ if ((active0 & 0x4000L) != 0L)
+ return jjStartNfaWithStates_1(3, 14, 30);
break;
case 115:
- return jjMoveStringLiteralDfa4_1(active0, 0x8000L);
+ return jjMoveStringLiteralDfa4_1(active0, 0x2000L);
case 116:
- return jjMoveStringLiteralDfa4_1(active0, 0x180000000000L);
+ return jjMoveStringLiteralDfa4_1(active0, 0x60000000000L);
default :
break;
}
@@ -561,14 +563,14 @@
switch(curChar)
{
case 97:
- return jjMoveStringLiteralDfa5_1(active0, 0x100000000000L);
+ return jjMoveStringLiteralDfa5_1(active0, 0x40000000000L);
case 101:
- if ((active0 & 0x8000L) != 0L)
- return jjStartNfaWithStates_1(4, 15, 36);
+ if ((active0 & 0x2000L) != 0L)
+ return jjStartNfaWithStates_1(4, 13, 30);
break;
case 121:
- if ((active0 & 0x80000000000L) != 0L)
- return jjStartNfaWithStates_1(4, 43, 36);
+ if ((active0 & 0x20000000000L) != 0L)
+ return jjStartNfaWithStates_1(4, 41, 30);
break;
default :
break;
@@ -587,7 +589,7 @@
switch(curChar)
{
case 110:
- return jjMoveStringLiteralDfa6_1(active0, 0x100000000000L);
+ return jjMoveStringLiteralDfa6_1(active0, 0x40000000000L);
default :
break;
}
@@ -605,7 +607,7 @@
switch(curChar)
{
case 99:
- return jjMoveStringLiteralDfa7_1(active0, 0x100000000000L);
+ return jjMoveStringLiteralDfa7_1(active0, 0x40000000000L);
default :
break;
}
@@ -623,7 +625,7 @@
switch(curChar)
{
case 101:
- return jjMoveStringLiteralDfa8_1(active0, 0x100000000000L);
+ return jjMoveStringLiteralDfa8_1(active0, 0x40000000000L);
default :
break;
}
@@ -641,7 +643,7 @@
switch(curChar)
{
case 111:
- return jjMoveStringLiteralDfa9_1(active0, 0x100000000000L);
+ return jjMoveStringLiteralDfa9_1(active0, 0x40000000000L);
default :
break;
}
@@ -659,8 +661,8 @@
switch(curChar)
{
case 102:
- if ((active0 & 0x100000000000L) != 0L)
- return jjStartNfaWithStates_1(9, 44, 36);
+ if ((active0 & 0x40000000000L) != 0L)
+ return jjStartNfaWithStates_1(9, 42, 30);
break;
default :
break;
@@ -696,7 +698,7 @@
private int jjMoveNfa_1(int startState, int curPos)
{
int startsAt = 0;
- jjnewStateCnt = 36;
+ jjnewStateCnt = 30;
int i = 1;
jjstateSet[0] = startState;
int kind = 0x7fffffff;
@@ -714,42 +716,42 @@
case 0:
if ((0x3ff000000000000L & l) != 0L)
{
- if (kind > 9)
- kind = 9;
- jjCheckNAddStates(4, 8);
+ if (kind > 8)
+ kind = 8;
+ jjCheckNAddStates(18, 22);
}
else if ((0x1800000000L & l) != 0L)
{
- if (kind > 53)
- kind = 53;
- jjCheckNAddTwoStates(34, 35);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAddTwoStates(28, 29);
}
else if (curChar == 39)
- jjCheckNAddStates(9, 13);
+ jjCheckNAddStates(23, 25);
else if (curChar == 34)
- jjCheckNAddStates(14, 18);
+ jjCheckNAddStates(26, 28);
else if (curChar == 46)
jjCheckNAdd(1);
break;
- case 36:
+ case 30:
if ((0x3ff001000000000L & l) != 0L)
{
- if (kind > 54)
- kind = 54;
- jjCheckNAdd(35);
+ if (kind > 52)
+ kind = 52;
+ jjCheckNAdd(29);
}
if ((0x3ff001000000000L & l) != 0L)
{
- if (kind > 53)
- kind = 53;
- jjCheckNAdd(34);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAdd(28);
}
break;
case 1:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 10)
- kind = 10;
+ if (kind > 9)
+ kind = 9;
jjCheckNAddTwoStates(1, 2);
break;
case 3:
@@ -759,136 +761,120 @@
case 4:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 10)
- kind = 10;
+ if (kind > 9)
+ kind = 9;
jjCheckNAdd(4);
break;
case 5:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 9)
- kind = 9;
- jjCheckNAddStates(4, 8);
+ if (curChar == 34)
+ jjCheckNAddStates(26, 28);
break;
case 6:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 9)
- kind = 9;
- jjCheckNAdd(6);
+ if ((0xfffffffbffffffffL & l) != 0L)
+ jjCheckNAddStates(26, 28);
break;
- case 7:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(7, 8);
- break;
case 8:
- if (curChar != 46)
- break;
- if (kind > 10)
- kind = 10;
- jjCheckNAddTwoStates(9, 10);
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(26, 28);
break;
case 9:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 10)
- kind = 10;
- jjCheckNAddTwoStates(9, 10);
+ if (curChar == 34 && kind > 11)
+ kind = 11;
break;
+ case 10:
+ if (curChar == 39)
+ jjCheckNAddStates(23, 25);
+ break;
case 11:
- if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(12);
+ if ((0xffffff7fffffffffL & l) != 0L)
+ jjCheckNAddStates(23, 25);
break;
- case 12:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 10)
- kind = 10;
- jjCheckNAdd(12);
- break;
case 13:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(13, 14);
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(23, 25);
break;
+ case 14:
+ if (curChar == 39 && kind > 11)
+ kind = 11;
+ break;
case 15:
- if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(16);
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 8)
+ kind = 8;
+ jjCheckNAddStates(18, 22);
break;
case 16:
if ((0x3ff000000000000L & l) == 0L)
break;
- if (kind > 10)
- kind = 10;
+ if (kind > 8)
+ kind = 8;
jjCheckNAdd(16);
break;
case 17:
- if (curChar == 34)
- jjCheckNAddStates(14, 18);
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(17, 18);
break;
case 18:
- if ((0xfffffffbffffffffL & l) != 0L)
- jjCheckNAddStates(19, 21);
+ if (curChar != 46)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAddTwoStates(19, 20);
break;
- case 20:
- if (curChar == 34)
- jjCheckNAddStates(19, 21);
+ case 19:
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAddTwoStates(19, 20);
break;
case 21:
- if (curChar == 34 && kind > 12)
- kind = 12;
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(22);
break;
case 22:
- if ((0xfffffffbffffffffL & l) != 0L)
- jjCheckNAddTwoStates(22, 23);
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(22);
break;
- case 24:
- if ((0xfffffffbffffffffL & l) != 0L && kind > 13)
- kind = 13;
+ case 23:
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddTwoStates(23, 24);
break;
case 25:
- if (curChar == 39)
- jjCheckNAddStates(9, 13);
+ if ((0x280000000000L & l) != 0L)
+ jjCheckNAdd(26);
break;
case 26:
- if ((0xffffff7fffffffffL & l) != 0L)
- jjCheckNAddStates(22, 24);
+ if ((0x3ff000000000000L & l) == 0L)
+ break;
+ if (kind > 9)
+ kind = 9;
+ jjCheckNAdd(26);
break;
- case 28:
- if (curChar == 39)
- jjCheckNAddStates(22, 24);
- break;
- case 29:
- if (curChar == 39 && kind > 12)
- kind = 12;
- break;
- case 30:
- if ((0xffffff7fffffffffL & l) != 0L)
- jjCheckNAddTwoStates(30, 31);
- break;
- case 32:
- if ((0xffffff7fffffffffL & l) != 0L && kind > 13)
- kind = 13;
- break;
- case 33:
+ case 27:
if ((0x1800000000L & l) == 0L)
break;
- if (kind > 53)
- kind = 53;
- jjCheckNAddTwoStates(34, 35);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAddTwoStates(28, 29);
break;
- case 34:
+ case 28:
if ((0x3ff001000000000L & l) == 0L)
break;
- if (kind > 53)
- kind = 53;
- jjCheckNAdd(34);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAdd(28);
break;
- case 35:
+ case 29:
if ((0x3ff001000000000L & l) == 0L)
break;
- if (kind > 54)
- kind = 54;
- jjCheckNAdd(35);
+ if (kind > 52)
+ kind = 52;
+ jjCheckNAdd(29);
break;
default : break;
}
@@ -904,94 +890,73 @@
case 0:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 53)
- kind = 53;
- jjCheckNAddTwoStates(34, 35);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAddTwoStates(28, 29);
break;
- case 36:
+ case 30:
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 54)
- kind = 54;
- jjCheckNAdd(35);
+ if (kind > 52)
+ kind = 52;
+ jjCheckNAdd(29);
}
if ((0x7fffffe87fffffeL & l) != 0L)
{
- if (kind > 53)
- kind = 53;
- jjCheckNAdd(34);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAdd(28);
}
break;
case 2:
if ((0x2000000020L & l) != 0L)
- jjAddStates(25, 26);
- break;
- case 10:
- if ((0x2000000020L & l) != 0L)
- jjAddStates(27, 28);
- break;
- case 14:
- if ((0x2000000020L & l) != 0L)
jjAddStates(29, 30);
break;
- case 18:
+ case 6:
if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(19, 21);
+ jjCheckNAddStates(26, 28);
break;
- case 19:
+ case 7:
if (curChar == 92)
- jjstateSet[jjnewStateCnt++] = 20;
+ jjstateSet[jjnewStateCnt++] = 8;
break;
- case 20:
+ case 8:
if (curChar == 92)
- jjCheckNAddStates(19, 21);
+ jjCheckNAddStates(26, 28);
break;
- case 22:
+ case 11:
if ((0xffffffffefffffffL & l) != 0L)
- jjAddStates(31, 32);
+ jjCheckNAddStates(23, 25);
break;
- case 23:
+ case 12:
if (curChar == 92)
- jjstateSet[jjnewStateCnt++] = 24;
+ jjstateSet[jjnewStateCnt++] = 13;
break;
- case 24:
- case 32:
- if ((0xffffffffefffffffL & l) != 0L && kind > 13)
- kind = 13;
- break;
- case 26:
- if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(22, 24);
- break;
- case 27:
+ case 13:
if (curChar == 92)
- jjstateSet[jjnewStateCnt++] = 28;
+ jjCheckNAddStates(23, 25);
break;
- case 28:
- if (curChar == 92)
- jjCheckNAddStates(22, 24);
+ case 20:
+ if ((0x2000000020L & l) != 0L)
+ jjAddStates(31, 32);
break;
- case 30:
- if ((0xffffffffefffffffL & l) != 0L)
+ case 24:
+ if ((0x2000000020L & l) != 0L)
jjAddStates(33, 34);
break;
- case 31:
- if (curChar == 92)
- jjstateSet[jjnewStateCnt++] = 32;
- break;
- case 34:
+ case 28:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 53)
- kind = 53;
- jjCheckNAdd(34);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAdd(28);
break;
- case 35:
+ case 29:
if ((0x7fffffe87fffffeL & l) == 0L)
break;
- if (kind > 54)
- kind = 54;
- jjCheckNAdd(35);
+ if (kind > 52)
+ kind = 52;
+ jjCheckNAdd(29);
break;
default : break;
}
@@ -1011,58 +976,45 @@
case 0:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
- if (kind > 53)
- kind = 53;
- jjCheckNAddTwoStates(34, 35);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAddTwoStates(28, 29);
break;
- case 36:
+ case 30:
if (jjCanMove_1(hiByte, i1, i2, l1, l2))
{
- if (kind > 53)
- kind = 53;
- jjCheckNAdd(34);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAdd(28);
}
if (jjCanMove_1(hiByte, i1, i2, l1, l2))
{
- if (kind > 54)
- kind = 54;
- jjCheckNAdd(35);
+ if (kind > 52)
+ kind = 52;
+ jjCheckNAdd(29);
}
break;
- case 18:
+ case 6:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(19, 21);
+ jjAddStates(26, 28);
break;
- case 22:
+ case 11:
if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(31, 32);
+ jjAddStates(23, 25);
break;
- case 24:
- case 32:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 13)
- kind = 13;
- break;
- case 26:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(22, 24);
- break;
- case 30:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(33, 34);
- break;
- case 34:
+ case 28:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
- if (kind > 53)
- kind = 53;
- jjCheckNAdd(34);
+ if (kind > 51)
+ kind = 51;
+ jjCheckNAdd(28);
break;
- case 35:
+ case 29:
if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
- if (kind > 54)
- kind = 54;
- jjCheckNAdd(35);
+ if (kind > 52)
+ kind = 52;
+ jjCheckNAdd(29);
break;
default : break;
}
@@ -1075,16 +1027,16 @@
kind = 0x7fffffff;
}
++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 36 - (jjnewStateCnt = startsAt)))
+ if ((i = jjnewStateCnt) == (startsAt = 30 - (jjnewStateCnt = startsAt)))
return curPos;
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
}
}
static final int[] jjnextStates = {
- 0, 1, 3, 5, 6, 7, 8, 13, 14, 26, 27, 29, 30, 31, 18, 19,
- 21, 22, 23, 18, 19, 21, 26, 27, 29, 3, 4, 11, 12, 15, 16, 22,
- 23, 30, 31,
+ 0, 1, 3, 4, 2, 0, 1, 4, 2, 0, 1, 4, 5, 2, 0, 1,
+ 2, 6, 16, 17, 18, 23, 24, 11, 12, 14, 6, 7, 9, 3, 4, 21,
+ 22, 25, 26,
};
private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
{
@@ -1122,12 +1074,12 @@
/** Token literal values. */
public static final String[] jjstrLiteralImages = {
"", null, "\44\173", "\43\173", null, null, null, null, null, null, null, null,
-null, null, "\164\162\165\145", "\146\141\154\163\145", "\156\165\154\154", "\175",
-"\56", "\50", "\51", "\133", "\135", "\72", "\54", "\76", "\147\164", "\74",
-"\154\164", "\76\75", "\147\145", "\74\75", "\154\145", "\75\75", "\145\161", "\41\75",
-"\156\145", "\41", "\156\157\164", "\46\46", "\141\156\144", "\174\174", "\157\162",
-"\145\155\160\164\171", "\151\156\163\164\141\156\143\145\157\146", "\52", "\53", "\55", "\77", "\57",
-"\144\151\166", "\45", "\155\157\144", null, null, null, null, null, null, };
+"\164\162\165\145", "\146\141\154\163\145", "\156\165\154\154", "\175", "\56", "\50", "\51",
+"\133", "\135", "\72", "\54", "\76", "\147\164", "\74", "\154\164", "\76\75",
+"\147\145", "\74\75", "\154\145", "\75\75", "\145\161", "\41\75", "\156\145", "\41",
+"\156\157\164", "\46\46", "\141\156\144", "\174\174", "\157\162", "\145\155\160\164\171",
+"\151\156\163\164\141\156\143\145\157\146", "\52", "\53", "\55", "\77", "\57", "\144\151\166", "\45", "\155\157\144", null,
+null, null, null, null, null, };
/** Lexer state names. */
public static final String[] lexStateNames = {
@@ -1137,19 +1089,19 @@
/** Lex State array. */
public static final int[] jjnewLexState = {
- -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1,
};
static final long[] jjtoToken = {
- 0x47ffffffffff60fL,
+ 0x11ffffffffffb0fL,
};
static final long[] jjtoSkip = {
- 0x1f0L,
+ 0xf0L,
};
protected SimpleCharStream input_stream;
-private final int[] jjrounds = new int[36];
-private final int[] jjstateSet = new int[72];
+private final int[] jjrounds = new int[30];
+private final int[] jjstateSet = new int[60];
protected char curChar;
/** Constructor. */
public ELParserTokenManager(SimpleCharStream stream){
@@ -1176,7 +1128,7 @@
{
int i;
jjround = 0x80000001;
- for (i = 36; i-- > 0;)
+ for (i = 30; i-- > 0;)
jjrounds[i] = 0x80000000;
}
@@ -1263,9 +1215,9 @@
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_1();
- if (jjmatchedPos == 0 && jjmatchedKind > 58)
+ if (jjmatchedPos == 0 && jjmatchedKind > 56)
{
- jjmatchedKind = 58;
+ jjmatchedKind = 56;
}
break;
}
Modified: trunk/java/org/apache/el/parser/Node.java
===================================================================
--- trunk/java/org/apache/el/parser/Node.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/Node.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -70,4 +70,5 @@
public void accept(NodeVisitor visitor) throws Exception;
public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) throws ELException;
public Object invoke(EvaluationContext ctx, Class[] paramTypes, Object[] paramValues) throws ELException;
+ public boolean isParametersProvided();
}
Modified: trunk/java/org/apache/el/parser/ParseException.java
===================================================================
--- trunk/java/org/apache/el/parser/ParseException.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/ParseException.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -100,7 +100,7 @@
if (!specialConstructor) {
return super.getMessage();
}
- StringBuilder expected = new StringBuilder();
+ StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expectedTokenSequences.length; i++) {
if (maxSize < expectedTokenSequences[i].length) {
@@ -150,7 +150,7 @@
* string literal.
*/
protected String add_escapes(String str) {
- StringBuilder retval = new StringBuilder();
+ StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
Modified: trunk/java/org/apache/el/parser/SimpleNode.java
===================================================================
--- trunk/java/org/apache/el/parser/SimpleNode.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/SimpleNode.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -162,4 +162,9 @@
public MethodInfo getMethodInfo(EvaluationContext ctx, Class[] paramTypes) throws ELException {
throw new UnsupportedOperationException();
}
+
+ public boolean isParametersProvided() {
+ return false;
+ }
+
}
Modified: trunk/java/org/apache/el/parser/TokenMgrError.java
===================================================================
--- trunk/java/org/apache/el/parser/TokenMgrError.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/el/parser/TokenMgrError.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -41,7 +41,7 @@
* equivalents in the given string
*/
protected static final String addEscapes(String str) {
- StringBuilder retval = new StringBuilder();
+ StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
Added: trunk/java/org/apache/jasper/compiler/AttributeParser.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/AttributeParser.java (rev 0)
+++ trunk/java/org/apache/jasper/compiler/AttributeParser.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -0,0 +1,333 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jasper.compiler;
+
+/**
+ * Converts a JSP attribute value into the unquoted equivalent. The attribute
+ * may contain EL expressions, in which case care needs to be taken to avoid any
+ * ambiguities. For example, consider the attribute values "${1+1}" and
+ * "\${1+1}". After unquoting, both appear as "${1+1}" but the first should
+ * evaluate to "2" and the second to "${1+1}". Literal \, $ and # need special
+ * treatment to ensure there is no ambiguity. The JSP attribute unquoting
+ * covers \\, \", \', \$, \#, %\>, <\%, ' and "
+ */
+public class AttributeParser {
+
+ /* System property that controls if the strict quoting rules are applied. */
+ private static final boolean STRICT_QUOTE_ESCAPING = Boolean.valueOf(
+ System.getProperty(
+ "org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING",
+ "true")).booleanValue();
+
+ /**
+ * Parses the provided input String as a JSP attribute and returns an
+ * unquoted value.
+ *
+ * @param input The input.
+ * @param quote The quote character for the attribute or 0 for
+ * scripting expressions.
+ * @param isELIgnored Is expression language being ignored on the page
+ * where the JSP attribute is defined.
+ * @return An unquoted JSP attribute that, if it contains
+ * expression language can be safely passed to the EL
+ * processor without fear of ambiguity.
+ */
+ public static String getUnquoted(String input, char quote,
+ boolean isELIgnored) {
+ return (new AttributeParser(input, quote, isELIgnored,
+ STRICT_QUOTE_ESCAPING)).getUnquoted();
+ }
+
+ /**
+ * Provided solely for unit test purposes and allows per call overriding of
+ * the STRICT_QUOTE_ESCAPING system property.
+ *
+ * @param input The input.
+ * @param quote The quote character for the attribute or 0 for
+ * scripting expressions.
+ * @param isELIgnored Is expression language being ignored on the page
+ * where the JSP attribute is defined.
+ * @param strict The value to use for STRICT_QUOTE_ESCAPING.
+ * @return An unquoted JSP attribute that, if it contains
+ * expression language can be safely passed to the EL
+ * processor without fear of ambiguity.
+ */
+ protected static String getUnquoted(String input, char quote,
+ boolean isELIgnored, boolean strict) {
+ return (new AttributeParser(input, quote, isELIgnored,
+ strict)).getUnquoted();
+ }
+
+ /* The quoted input string. */
+ private final String input;
+
+ /* The quote used for the attribute - null for scripting expressions. */
+ private final char quote;
+
+ /* Is expression language being ignored - affects unquoting. \$ and \# are
+ * treated as literals rather than quoted values. */
+ private final boolean isELIgnored;
+
+ /* Overrides the STRICT_QUOTE_ESCAPING. Used for Unit tests only. */
+ private final boolean strict;
+
+ /* The type ($ or #) of expression. Literals have a type of null. */
+ private char type;
+
+ /* The length of the quoted input string. */
+ private final int size;
+
+ /* Tracks the current position of the parser in the input String. */
+ private int i = 0;
+
+ /* Indicates if the last character returned by nextChar() was escaped. */
+ private boolean lastChEscaped = false;
+
+ /* The unquoted result. */
+ private StringBuilder result;
+
+
+ /**
+ * For test purposes.
+ * @param input
+ * @param quote
+ * @param strict
+ */
+ private AttributeParser(String input, char quote,
+ boolean isELIgnored, boolean strict) {
+ this.input = input;
+ this.quote = quote;
+ // If quote is null this is a scriptign expressions and any EL syntax
+ // should be ignored
+ this.isELIgnored = isELIgnored || (quote == 0);
+ this.strict = strict;
+ this.type = getType(input);
+ this.size = input.length();
+ result = new StringBuilder(size);
+ }
+
+ /*
+ * Work through input looking for literals and expressions until the input
+ * has all been read.
+ */
+ private String getUnquoted() {
+ while (i < size) {
+ parseLiteral();
+ parseEL();
+ }
+ return result.toString();
+ }
+
+ /*
+ * This method gets the next unquoted character and looks for
+ * - literals that need to be converted for EL processing
+ * \ -> type{'\\'}
+ * $ -> type{'$'}
+ * # -> type{'$'}
+ * - start of EL
+ * ${
+ * #{
+ * Note all the examples above *do not* include the escaping required to use
+ * the values in Java code.
+ */
+ private void parseLiteral() {
+ boolean foundEL = false;
+ while (i < size && !foundEL) {
+ char ch = nextChar();
+ if (!isELIgnored && ch == '\\') {
+ if (type == 0) {
+ type = '$';
+ }
+ result.append(type);
+ result.append("{'\\\\'}");
+ } else if (!isELIgnored && ch == '$' && lastChEscaped){
+ if (type == 0) {
+ type = '$';
+ }
+ result.append(type);
+ result.append("{'$'}");
+ } else if (!isELIgnored && ch == '#' && lastChEscaped){
+ if (type == 0) {
+ type = '$';
+ }
+ result.append(type);
+ result.append("{'#'}");
+ } else if (ch == type){
+ if (i < size) {
+ char next = input.charAt(i);
+ if (next == '{') {
+ foundEL = true;
+ // Move back to start of EL
+ i--;
+ } else {
+ result.append(ch);
+ }
+ } else {
+ result.append(ch);
+ }
+ } else {
+ result.append(ch);
+ }
+ }
+ }
+
+ /*
+ * For EL need to unquote everything but no need to convert anything. The
+ * EL is terminated by '}'. The only other valid location for '}' is inside
+ * a StringLiteral. The literals are delimited by '\'' or '\"'. The only
+ * other valid location for '\'' or '\"' is also inside a StringLiteral. A
+ * quote character inside a StringLiteral must be escaped if the same quote
+ * character is used to delimit the StringLiteral.
+ */
+ private void parseEL() {
+ boolean endEL = false;
+ boolean insideLiteral = false;
+ while (i < size && !endEL) {
+ char literalQuote = '\'';
+ char ch = nextChar();
+ if (ch == '\'' || ch == '\"') {
+ if (insideLiteral) {
+ if (literalQuote == ch) {
+ insideLiteral = false;
+ }
+ } else {
+ insideLiteral = true;
+ literalQuote = ch;
+ }
+ result.append(ch);
+ } else if (ch == '\\') {
+ result.append(ch);
+ if (insideLiteral && size < i) {
+ ch = nextChar();
+ result.append(ch);
+ }
+ } else if (ch == '}') {
+ if (!insideLiteral) {
+ endEL = true;
+ }
+ result.append(ch);
+ } else {
+ result.append(ch);
+ }
+ }
+ }
+
+ /*
+ * Returns the nest unquoted character and sets the lastChEscaped flag to
+ * indicate if it was quoted/escaped or not.
+ * ' is always unquoted to '
+ * " is always unquoted to "
+ * \" is always unquoted to "
+ * \' is always unquoted to '
+ * \\ is always unquoted to \
+ * \$ is unquoted to $ if EL is not being ignored
+ * \# is unquoted to # if EL is not being ignored
+ * <\% is always unquoted to <%
+ * %\> is always unquoted to %>
+ */
+ private char nextChar() {
+ lastChEscaped = false;
+ char ch = input.charAt(i);
+
+ if (ch == '&') {
+ if (i + 5 < size && input.charAt(i + 1) == 'a' &&
+ input.charAt(i + 2) == 'p' && input.charAt(i + 3) == 'o' &&
+ input.charAt(i + 4) == 's' && input.charAt(i + 5) == ';') {
+ ch = '\'';
+ i += 6;
+ } else if (i + 5 < size && input.charAt(i + 1) == 'q' &&
+ input.charAt(i + 2) == 'u' && input.charAt(i + 3) == 'o' &&
+ input.charAt(i + 4) == 't' && input.charAt(i + 5) == ';') {
+ ch = '\"';
+ i += 6;
+ } else {
+ ++i;
+ }
+ } else if (ch == '\\' && i + 1 < size) {
+ ch = input.charAt(i + 1);
+ if (ch == '\\' || ch == '\"' || ch == '\'' ||
+ (!isELIgnored && (ch == '$' || ch == '#'))) {
+ i += 2;
+ lastChEscaped = true;
+ } else {
+ ch = '\\';
+ ++i;
+ }
+ } else if (ch == '<' && (i + 2 < size) && input.charAt(i + 1) == '\\' &&
+ input.charAt(i + 2) == '%') {
+ // Note this is a hack since nextChar only returns a single char
+ // It is safe since <% does not require special treatment for EL
+ // or for literals
+ result.append('<');
+ i+=3;
+ return '%';
+ } else if (ch == '%' && i + 2 < size && input.charAt(i + 1) == '\\' &&
+ input.charAt(i + 2) == '>') {
+ // Note this is a hack since nextChar only returns a single char
+ // It is safe since %> does not require special treatment for EL
+ // or for literals
+ result.append('%');
+ i+=3;
+ return '>';
+ } else if (ch == quote && strict) {
+ String msg = Localizer.getMessage("jsp.error.attribute.noescape",
+ input, ""+ quote);
+ throw new IllegalArgumentException(msg);
+ } else {
+ ++i;
+ }
+
+ return ch;
+ }
+
+ /*
+ * Determines the type of expression by looking for the first unquoted ${
+ * or #{.
+ */
+ private char getType(String value) {
+ if (value == null) {
+ return 0;
+ }
+
+ if (isELIgnored) {
+ return 0;
+ }
+
+ int j = 0;
+ int len = value.length();
+ char current;
+
+ while (j < len) {
+ current = value.charAt(j);
+ if (current == '\\') {
+ // Escape character - skip a character
+ j++;
+ } else if (current == '#') {
+ if (j < (len -1) && value.charAt(j + 1) == '{') {
+ return '#';
+ }
+ } else if (current == '$') {
+ if (j < (len - 1) && value.charAt(j + 1) == '{') {
+ return '$';
+ }
+ }
+ j++;
+ }
+ return 0;
+ }
+}
Modified: trunk/java/org/apache/jasper/compiler/ELParser.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/ELParser.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/jasper/compiler/ELParser.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -31,6 +31,7 @@
public class ELParser {
private Token curToken; // current token
+ private Token prevToken; // previous token
private ELNode.Nodes expr;
@@ -118,27 +119,28 @@
* arguments
*/
private boolean parseFunction() {
- if (!(curToken instanceof Id) || isELReserved(curToken.toString())) {
+ if (!(curToken instanceof Id) || isELReserved(curToken.toString()) ||
+ prevToken instanceof Char && prevToken.toChar() == '.') {
return false;
}
String s1 = null; // Function prefix
String s2 = curToken.toString(); // Function name
int mark = getIndex();
if (hasNext()) {
- Token t = nextToken();
- if (t.toChar() == ':') {
+ curToken = nextToken();
+ if (curToken.toChar() == ':') {
if (hasNext()) {
Token t2 = nextToken();
if (t2 instanceof Id) {
s1 = s2;
s2 = t2.toString();
if (hasNext()) {
- t = nextToken();
+ curToken = nextToken();
}
}
}
}
- if (t.toChar() == '(') {
+ if (curToken.toChar() == '(') {
ELexpr.add(new ELNode.Function(s1, s2));
return true;
}
@@ -223,6 +225,7 @@
* @return The next token in the EL expression buffer.
*/
private Token nextToken() {
+ prevToken = curToken;
skipSpaces();
if (hasNextChar()) {
char ch = nextChar();
Modified: trunk/java/org/apache/jasper/compiler/Generator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Generator.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/jasper/compiler/Generator.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -816,8 +816,8 @@
}
return v;
} else if (attr.isELInterpreterInput()) {
- v = attributeValueWithEL(this.isTagFile, v, expectedType,
- attr.getEL().getMapName());
+ v = JspUtil.interpreterCall(this.isTagFile, v, expectedType,
+ attr.getEL().getMapName(), false);
if (encode) {
return "org.apache.jasper.runtime.JspRuntimeLibrary.URLEncode("
+ v + ", request.getCharacterEncoding())";
@@ -835,124 +835,6 @@
}
- /*
- * When interpreting the EL attribute value, literals outside the EL
- * must not be unescaped but the EL processor will unescape them.
- * Therefore, make sure only the EL expressions are processed by the EL
- * processor.
- */
- private String attributeValueWithEL(boolean isTag, String tx,
- Class<?> expectedType, String mapName) {
- if (tx==null) return null;
- Class<?> type = expectedType;
- int size = tx.length();
- StringBuilder output = new StringBuilder(size);
- boolean el = false;
- int i = 0;
- int mark = 0;
- char ch;
-
- while(i < size){
- ch = tx.charAt(i);
-
- // Start of an EL expression
- if (!el && i+1 < size && ch == '$' && tx.charAt(i+1)=='{') {
- if (mark < i) {
- if (output.length() > 0) {
- output.append(" + ");
- // Composite expression - must coerce to String
- type = String.class;
- }
- if (i+1 < size) {
- // Composite expression - must coerce to String
- type = String.class;
- }
- output.append(quote(tx.substring(mark, i)));
- }
- mark = i;
- el = true;
- i += 2;
- } else if (ch=='\\' && i+1 < size &&
- (tx.charAt(i+1)=='$' || tx.charAt(i+1)=='}')) {
- // Skip an escaped $ or }
- i += 2;
- } else if (el && ch=='}') {
- // End of an EL expression
- if (output.length() > 0) {
- output.append(" + ");
- // Composite expression - must coerce to String
- type = String.class;
- }
- output.append(
- JspUtil.interpreterCall(isTag,
- tx.substring(mark, i+1), type,
- mapName, false));
- mark = i + 1;
- el = false;
- ++i;
- } else {
- // Nothing to see here - move to next character
- ++i;
- }
- }
- if (!el && mark < i) {
- if (output.length() > 0) {
- output.append(" + ");
- }
- output.append(quote(tx.substring(mark, i)));
- }
- if (expectedType != type && !expectedType.isAssignableFrom(type)) {
- // Composite expression was evaluated to String
- // We must coerce it to the expected type.
- String className = JspUtil.getCanonicalName(expectedType);
- String methodName = null;
- if (expectedType.isPrimitive()) {
- if (expectedType == Boolean.TYPE) {
- className = "Boolean";
- methodName = ".booleanValue()";
- }
- else if (expectedType == Character.TYPE) {
- className = "Character";
- methodName = ".charValue()";
- }
- else if (expectedType == Byte.TYPE) {
- className = "Byte";
- methodName = ".byteValue()";
- }
- else if (expectedType == Short.TYPE) {
- className = "Short";
- methodName = ".shortValue()";
- }
- else if (expectedType == Integer.TYPE) {
- className = "Integer";
- methodName = ".intValue()";
- }
- else if (expectedType == Long.TYPE) {
- className = "Long";
- methodName = ".longValue()";
- }
- else if (expectedType == Float.TYPE) {
- className = "Float";
- methodName = ".floatValue()";
- }
- else if (expectedType == Double.TYPE) {
- className = "Double";
- methodName = ".doubleValue()";
- }
- }
- output.insert(0, "(("
- + className
- + ")org.apache.el.lang.ELSupport.coerceToType(");
- output.append(",").append(className).append(".class))");
- if (methodName != null) {
- output.insert(0, '(');
- output.append(methodName).append(')');
- }
- }
- return output.toString();
- }
-
-
/**
* Prints the attribute value specified in the param action, in the form
* of name=value string.
@@ -3007,8 +2889,8 @@
// run attrValue through the expression interpreter
String mapName = (attr.getEL() != null) ? attr.getEL()
.getMapName() : null;
- attrValue = attributeValueWithEL(this.isTagFile,
- attrValue, c[0], mapName);
+ attrValue = JspUtil.interpreterCall(this.isTagFile, attrValue,
+ c[0], mapName, false);
}
} else {
attrValue = convertString(c[0], attrValue, localName,
Modified: trunk/java/org/apache/jasper/compiler/Parser.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Parser.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/jasper/compiler/Parser.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -74,11 +74,6 @@
private static final String JAVAX_BODY_CONTENT_TEMPLATE_TEXT = "JAVAX_BODY_CONTENT_TEMPLATE_TEXT";
- private static final boolean STRICT_QUOTE_ESCAPING = Boolean.valueOf(
- System.getProperty(
- "org.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING",
- "true")).booleanValue();
-
/**
* The constructor
*/
@@ -245,66 +240,25 @@
err.jspError(start, "jsp.error.attribute.unterminated", watch);
}
- String ret = parseQuoted(start, reader.getText(start, stop),
- watch.charAt(watch.length() - 1));
+ String ret = null;
+ try {
+ char quote = 0;
+ if (watch.length() == 1) {
+ quote = watch.charAt(0);
+ }
+ ret = AttributeParser.getUnquoted(reader.getText(start, stop),
+ quote, pageInfo.isELIgnored());
+ } catch (IllegalArgumentException iae) {
+ err.jspError(start, iae.getMessage());
+ }
if (watch.length() == 1) // quote
return ret;
- // putback delimiter '<%=' and '%>', since they are needed if the
+ // Put back delimiter '<%=' and '%>', since they are needed if the
// attribute does not allow RTexpression.
return "<%=" + ret + "%>";
}
- /**
- * QuotedChar ::= ''' | '"' | '\\' | '\"' | "\'" | '\>' | '\$' |
- * Char
- */
- private String parseQuoted(Mark start, String tx, char quote)
- throws JasperException {
- StringBuilder buf = new StringBuilder();
- int size = tx.length();
- int i = 0;
- while (i < size) {
- char ch = tx.charAt(i);
- if (ch == '&') {
- if (i + 5 < size && tx.charAt(i + 1) == 'a'
- && tx.charAt(i + 2) == 'p' && tx.charAt(i + 3) == 'o'
- && tx.charAt(i + 4) == 's' && tx.charAt(i + 5) == ';') {
- buf.append('\'');
- i += 6;
- } else if (i + 5 < size && tx.charAt(i + 1) == 'q'
- && tx.charAt(i + 2) == 'u' && tx.charAt(i + 3) == 'o'
- && tx.charAt(i + 4) == 't' && tx.charAt(i + 5) == ';') {
- buf.append('"');
- i += 6;
- } else {
- buf.append(ch);
- ++i;
- }
- } else if (ch == '\\' && i + 1 < size) {
- ch = tx.charAt(i + 1);
- if (ch == '\\' || ch == '\"' || ch == '\'' || ch == '>') {
- // \ " and ' are always unescaped regardless of if they are
- // inside or outside of an EL expression. JSP.1.6 takes
- // precedence over JSP.1.3.10 (confirmed with EG).
- buf.append(ch);
- i += 2;
- } else {
- buf.append('\\');
- ++i;
- }
- } else if (ch == quote && STRICT_QUOTE_ESCAPING) {
- // Unescaped quote character
- err.jspError(start, "jsp.error.attribute.noescape", tx,
- "" + quote);
- } else {
- buf.append(ch);
- ++i;
- }
- }
- return buf.toString();
- }
-
private String parseScriptText(String tx) {
CharArrayWriter cw = new CharArrayWriter();
int size = tx.length();
Modified: trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java
===================================================================
--- trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/java/org/apache/jasper/runtime/JspApplicationContextImpl.java 2010-01-14 14:48:10 UTC (rev 1355)
@@ -38,7 +38,6 @@
import javax.servlet.jsp.el.ImplicitObjectELResolver;
import javax.servlet.jsp.el.ScopedAttributeELResolver;
-import org.apache.el.ExpressionFactoryImpl;
import org.apache.jasper.Constants;
import org.apache.jasper.el.ELContextImpl;
@@ -51,7 +50,8 @@
private final static String KEY = JspApplicationContextImpl.class.getName();
- private final static ExpressionFactory expressionFactory = new ExpressionFactoryImpl();
+ private final static ExpressionFactory expressionFactory =
+ ExpressionFactory.newInstance();
private final List<ELContextListener> contextListeners = new ArrayList<ELContextListener>();
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-01-13 14:36:21 UTC (rev 1354)
+++ trunk/webapps/docs/changelog.xml 2010-01-14 14:48:10 UTC (rev 1355)
@@ -29,7 +29,9 @@
<fix>
<bug>47977</bug>: Check empty body in tags. (markt)
</fix>
-
+ <fix>
+ EL escaping fixes. (markt)
+ </fix>
</changelog>
</subsection>
</section>
14 years, 11 months
JBossWeb SVN: r1354 - in trunk: java/org/apache/jasper/compiler and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-13 09:36:21 -0500 (Wed, 13 Jan 2010)
New Revision: 1354
Modified:
trunk/java/org/apache/catalina/realm/JNDIRealm.java
trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
trunk/webapps/docs/changelog.xml
Log:
- Two minor ports.
Modified: trunk/java/org/apache/catalina/realm/JNDIRealm.java
===================================================================
--- trunk/java/org/apache/catalina/realm/JNDIRealm.java 2010-01-07 14:32:03 UTC (rev 1353)
+++ trunk/java/org/apache/catalina/realm/JNDIRealm.java 2010-01-13 14:36:21 UTC (rev 1354)
@@ -1884,8 +1884,12 @@
User user = getUser(context, username);
- return new GenericPrincipal(this, user.username, user.password ,
- getRoles(context, user));
+ if (user != null) {
+ return new GenericPrincipal(this, user.username, user.password ,
+ getRoles(context, user));
+ } else {
+ return null;
+ }
}
/**
Modified: trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JspDocumentParser.java 2010-01-07 14:32:03 UTC (rev 1353)
+++ trunk/java/org/apache/jasper/compiler/JspDocumentParser.java 2010-01-13 14:36:21 UTC (rev 1354)
@@ -110,6 +110,8 @@
// Flag set to delay incrmenting tagDependentNesting until jsp:body
// is first encountered
private boolean tagDependentPending = false;
+ // Tag being parsed that should have an empty body
+ private Node tagEmptyBody = null;
/*
* Constructor
@@ -269,6 +271,8 @@
AttributesImpl nonTaglibAttrs = null;
AttributesImpl nonTaglibXmlnsAttrs = null;
+ checkEmptyBody();
+
processChars();
checkPrefixes(uri, qName, attrs);
@@ -429,9 +433,10 @@
if (scriptlessBodyNode == null
&& bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_SCRIPTLESS)) {
scriptlessBodyNode = node;
- }
- else if (TagInfo.BODY_CONTENT_TAG_DEPENDENT.equalsIgnoreCase(bodyType)) {
+ } else if (TagInfo.BODY_CONTENT_TAG_DEPENDENT.equalsIgnoreCase(bodyType)) {
tagDependentPending = true;
+ } else if (TagInfo.BODY_CONTENT_EMPTY.equals(bodyType)) {
+ tagEmptyBody = node;
}
}
}
@@ -455,8 +460,9 @@
*
* @throws SAXException
*/
- public void characters(char[] buf, int offset, int len) {
-
+ public void characters(char[] buf, int offset, int len)
+ throws SAXException {
+ checkEmptyBody();
if (charBuffer == null) {
charBuffer = new StringBuilder();
}
@@ -614,6 +620,10 @@
public void endElement(String uri, String localName, String qName)
throws SAXException {
+ if (tagEmptyBody != null) {
+ tagEmptyBody = null;
+ }
+
processChars();
if (directivesOnly &&
@@ -703,6 +713,7 @@
*/
public void startCDATA() throws SAXException {
+ checkEmptyBody();
processChars(); // Flush char buffer and remove white spaces
startMark = new Mark(ctxt, path, locator.getLineNumber(),
locator.getColumnNumber());
@@ -1389,6 +1400,14 @@
return "";
}
+ private void checkEmptyBody() throws SAXException {
+ if (tagEmptyBody != null) {
+ throw new SAXParseException(Localizer.getMessage(
+ "jasper.error.emptybodycontent.nonempty",
+ tagEmptyBody.qName), locator);
+ }
+ }
+
/*
* Gets SAXParser.
*
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2010-01-07 14:32:03 UTC (rev 1353)
+++ trunk/webapps/docs/changelog.xml 2010-01-13 14:36:21 UTC (rev 1354)
@@ -16,7 +16,25 @@
<body>
-<section name="JBoss Web 3.0.0.CR1 (remm)">
+<section name="JBoss Web 3.0.0.Beta2 (remm)">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ <bug>48516</bug>: Possible NPE in JNDI realm. (markt)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <bug>47977</bug>: Check empty body in tags. (markt)
+ </fix>
+
+ </changelog>
+ </subsection>
+</section>
+
+<section name="JBoss Web 3.0.0.Beta1 (remm)">
<subsection name="General">
<changelog>
<update>
14 years, 11 months
JBossWeb SVN: r1353 - trunk/java/org/apache/jasper/compiler.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-07 09:32:03 -0500 (Thu, 07 Jan 2010)
New Revision: 1353
Modified:
trunk/java/org/apache/jasper/compiler/Validator.java
Log:
- Port patch.
Modified: trunk/java/org/apache/jasper/compiler/Validator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Validator.java 2010-01-06 16:10:05 UTC (rev 1352)
+++ trunk/java/org/apache/jasper/compiler/Validator.java 2010-01-07 14:32:03 UTC (rev 1353)
@@ -511,7 +511,7 @@
public void visit(Node.JspRoot n) throws JasperException {
JspUtil.checkAttributes("Jsp:root", n, jspRootAttrs, err);
String version = n.getTextAttribute("version");
- if (!version.equals("1.2") && !version.equals("2.0") && !version.equals("2.1")) {
+ if (!version.equals("1.2") && !version.equals("2.0") && !version.equals("2.1") && !version.equals("2.2")) {
err.jspError(n, "jsp.error.jsproot.version.invalid", version);
}
visitBody(n);
14 years, 12 months
JBossWeb SVN: r1352 - in trunk: lib and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-06 11:10:05 -0500 (Wed, 06 Jan 2010)
New Revision: 1352
Added:
trunk/lib/xnio-api-2.0.1.GA-sources.jar
trunk/lib/xnio-api-2.0.1.GA.jar
trunk/lib/xnio-nio-2.0.1.GA-sources.jar
trunk/lib/xnio-nio-2.0.1.GA.jar
Modified:
trunk/.classpath
Log:
..
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2010-01-04 16:32:17 UTC (rev 1351)
+++ trunk/.classpath 2010-01-06 16:10:05 UTC (rev 1352)
@@ -2,5 +2,7 @@
<classpath>
<classpathentry excluding="**/.svn/**" kind="src" path="java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="lib/xnio-api-2.0.1.GA.jar" sourcepath="lib/xnio-api-2.0.1.GA-sources.jar"/>
+ <classpathentry kind="lib" path="lib/xnio-nio-2.0.1.GA.jar" sourcepath="lib/xnio-nio-2.0.1.GA-sources.jar"/>
<classpathentry kind="output" path=".settings/output"/>
</classpath>
Added: trunk/lib/xnio-api-2.0.1.GA-sources.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/xnio-api-2.0.1.GA-sources.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lib/xnio-api-2.0.1.GA.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/xnio-api-2.0.1.GA.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lib/xnio-nio-2.0.1.GA-sources.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/xnio-nio-2.0.1.GA-sources.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/lib/xnio-nio-2.0.1.GA.jar
===================================================================
(Binary files differ)
Property changes on: trunk/lib/xnio-nio-2.0.1.GA.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 12 months
JBossWeb SVN: r1351 - in trunk/java/org/apache: jasper/compiler and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2010-01-04 11:32:17 -0500 (Mon, 04 Jan 2010)
New Revision: 1351
Modified:
trunk/java/org/apache/catalina/session/PersistentManagerBase.java
trunk/java/org/apache/catalina/session/StoreBase.java
trunk/java/org/apache/jasper/compiler/Generator.java
trunk/java/org/apache/jasper/compiler/JspUtil.java
trunk/java/org/apache/jasper/compiler/Validator.java
trunk/java/org/apache/jasper/resources/LocalStrings.properties
Log:
- Port Tomcat patches.
- All minor, with the exception of some EL fixes.
Modified: trunk/java/org/apache/catalina/session/PersistentManagerBase.java
===================================================================
--- trunk/java/org/apache/catalina/session/PersistentManagerBase.java 2009-12-17 17:45:16 UTC (rev 1350)
+++ trunk/java/org/apache/catalina/session/PersistentManagerBase.java 2010-01-04 16:32:17 UTC (rev 1351)
@@ -24,6 +24,9 @@
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.catalina.Container;
import org.apache.catalina.Context;
import org.apache.catalina.Lifecycle;
@@ -205,6 +208,13 @@
protected long processingTime = 0;
+ /**
+ * Sessions currently being swapped in and the associated locks
+ */
+ private final Map<String,Object> sessionSwapInLocks =
+ new HashMap<String,Object>();
+
+
// ------------------------------------------------------------- Properties
@@ -382,7 +392,7 @@
/**
- * Set the maximum number of actives Sessions allowed, or -1 for
+ * Set the maximum number of active Sessions allowed, or -1 for
* no limit.
*
* @param max The new maximum number of sessions
@@ -771,54 +781,89 @@
if (store == null)
return null;
+ Object swapInLock = null;
+
+ /*
+ * The purpose of this sync and these locks is to make sure that a
+ * session is only loaded once. It doesn't matter if the lock is removed
+ * and then another thread enters this method and tries to load the same
+ * session. That thread will re-create a swapIn lock for that session,
+ * quickly find that the session is already in sessions, use it and
+ * carry on.
+ */
+ synchronized (this) {
+ swapInLock = sessionSwapInLocks.get(id);
+ if (swapInLock == null) {
+ swapInLock = new Object();
+ sessionSwapInLocks.put(id, swapInLock);
+ }
+ }
+
Session session = null;
- try {
- if (SecurityUtil.isPackageProtectionEnabled()){
- try{
- session = (Session)
- AccessController.doPrivileged(new PrivilegedStoreLoad(id));
- }catch(PrivilegedActionException ex){
- Exception exception = ex.getException();
- log.error("Exception in the Store during swapIn: "
- + exception);
- if (exception instanceof IOException){
- throw (IOException)exception;
- } else if (exception instanceof ClassNotFoundException) {
- throw (ClassNotFoundException)exception;
+
+ synchronized (swapInLock) {
+ // First check to see if another thread has loaded the session into
+ // the manager
+ session = sessions.get(id);
+
+ if (session == null) {
+ try {
+ if (SecurityUtil.isPackageProtectionEnabled()){
+ try {
+ session = (Session) AccessController.doPrivileged(
+ new PrivilegedStoreLoad(id));
+ } catch (PrivilegedActionException ex) {
+ Exception e = ex.getException();
+ log.error(sm.getString(
+ "persistentManager.swapInException", id),
+ e);
+ if (e instanceof IOException){
+ throw (IOException)e;
+ } else if (e instanceof ClassNotFoundException) {
+ throw (ClassNotFoundException)e;
+ }
+ }
+ } else {
+ session = store.load(id);
}
+ } catch (ClassNotFoundException e) {
+ String msg = sm.getString(
+ "persistentManager.deserializeError", id);
+ log.error(msg, e);
+ throw new IllegalStateException(msg, e);
}
- } else {
- session = store.load(id);
- }
- } catch (ClassNotFoundException e) {
- log.error(sm.getString("persistentManager.deserializeError", id, e));
- throw new IllegalStateException
- (sm.getString("persistentManager.deserializeError", id, e));
- }
- if (session == null)
- return (null);
+ if (session != null && !session.isValid()) {
+ log.error(sm.getString(
+ "persistentManager.swapInInvalid", id));
+ session.expire();
+ removeSession(id);
+ session = null;
+ }
- if (!session.isValid()) {
- log.error("session swapped in is invalid or expired");
- session.expire();
- removeSession(id);
- return (null);
+ if (session != null) {
+ if(log.isDebugEnabled())
+ log.debug(sm.getString("persistentManager.swapIn", id));
+
+ session.setManager(this);
+ // make sure the listeners know about it.
+ ((StandardSession)session).tellNew();
+ add(session);
+ ((StandardSession)session).activate();
+ // endAccess() to ensure timeouts happen correctly.
+ // access() to keep access count correct or it will end up
+ // negative
+ session.access();
+ session.endAccess();
+ }
+ }
}
- if(log.isDebugEnabled())
- log.debug(sm.getString("persistentManager.swapIn", id));
+ // Make sure the lock is removed
+ synchronized (this) {
+ sessionSwapInLocks.remove(id);
+ }
- session.setManager(this);
- // make sure the listeners know about it.
- ((StandardSession)session).tellNew();
- add(session);
- ((StandardSession)session).activate();
- // endAccess() to ensure timeouts happen correctly.
- // access() to keep access count correct or it will end up negative
- session.access();
- session.endAccess();
-
return (session);
}
Modified: trunk/java/org/apache/catalina/session/StoreBase.java
===================================================================
--- trunk/java/org/apache/catalina/session/StoreBase.java 2009-12-17 17:45:16 UTC (rev 1350)
+++ trunk/java/org/apache/catalina/session/StoreBase.java 2010-01-04 16:32:17 UTC (rev 1351)
@@ -173,7 +173,6 @@
*
*/
public void processExpires() {
- long timeNow = System.currentTimeMillis();
String[] keys = null;
if(!started) {
@@ -190,13 +189,16 @@
manager.getContainer().getLogger().debug(getStoreName()+ ": processExpires check number of " + keys.length + " sessions" );
}
+ long timeNow = System.currentTimeMillis();
+
for (int i = 0; i < keys.length; i++) {
try {
StandardSession session = (StandardSession) load(keys[i]);
if (session == null) {
continue;
}
- if (session.isValid()) {
+ int timeIdle = (int) ((timeNow - session.getThisAccessedTime()) / 1000L);
+ if (timeIdle < session.getMaxInactiveInterval()) {
continue;
}
if (manager.getContainer().getLogger().isDebugEnabled()) {
@@ -209,7 +211,7 @@
// expire swapped out session
session.expire();
}
- remove(session.getIdInternal());
+ remove(keys[i]);
} catch (Exception e) {
manager.getContainer().getLogger().error("Session: "+keys[i]+"; ", e);
try {
Modified: trunk/java/org/apache/jasper/compiler/Generator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Generator.java 2009-12-17 17:45:16 UTC (rev 1350)
+++ trunk/java/org/apache/jasper/compiler/Generator.java 2010-01-04 16:32:17 UTC (rev 1351)
@@ -901,6 +901,54 @@
}
output.append(quote(tx.substring(mark, i)));
}
+ if (expectedType != type && !expectedType.isAssignableFrom(type)) {
+ // Composite expression was evaluated to String
+ // We must coerce it to the expected type.
+ String className = JspUtil.getCanonicalName(expectedType);
+ String methodName = null;
+ if (expectedType.isPrimitive()) {
+ if (expectedType == Boolean.TYPE) {
+ className = "Boolean";
+ methodName = ".booleanValue()";
+ }
+ else if (expectedType == Character.TYPE) {
+ className = "Character";
+ methodName = ".charValue()";
+ }
+ else if (expectedType == Byte.TYPE) {
+ className = "Byte";
+ methodName = ".byteValue()";
+ }
+ else if (expectedType == Short.TYPE) {
+ className = "Short";
+ methodName = ".shortValue()";
+ }
+ else if (expectedType == Integer.TYPE) {
+ className = "Integer";
+ methodName = ".intValue()";
+ }
+ else if (expectedType == Long.TYPE) {
+ className = "Long";
+ methodName = ".longValue()";
+ }
+ else if (expectedType == Float.TYPE) {
+ className = "Float";
+ methodName = ".floatValue()";
+ }
+ else if (expectedType == Double.TYPE) {
+ className = "Double";
+ methodName = ".doubleValue()";
+ }
+ }
+ output.insert(0, "(("
+ + className
+ + ")org.apache.el.lang.ELSupport.coerceToType(");
+ output.append(",").append(className).append(".class))");
+ if (methodName != null) {
+ output.insert(0, '(');
+ output.append(methodName).append(')');
+ }
+ }
return output.toString();
}
@@ -1298,12 +1346,13 @@
}
}
+ // JSP.5.1, Sematics, para 1 - lock not required for request or
+ // page scope
String scopename = "PageContext.PAGE_SCOPE"; // Default to page
- String lock = "_jspx_page_context";
+ String lock = null;
if ("request".equals(scope)) {
scopename = "PageContext.REQUEST_SCOPE";
- lock = "request";
} else if ("session".equals(scope)) {
scopename = "PageContext.SESSION_SCOPE";
lock = "session";
@@ -1320,11 +1369,13 @@
out.print(name);
out.println(" = null;");
- // Lock while getting or creating bean
- out.printin("synchronized (");
- out.print(lock);
- out.println(") {");
- out.pushIndent();
+ // Lock (if required) while getting or creating bean
+ if (lock != null) {
+ out.printin("synchronized (");
+ out.print(lock);
+ out.println(") {");
+ out.pushIndent();
+ }
// Locate bean from context
out.printin(name);
@@ -1427,8 +1478,10 @@
out.printil("}");
// End of lock block
- out.popIndent();
- out.printil("}");
+ if (lock != null) {
+ out.popIndent();
+ out.printil("}");
+ }
n.setEndJavaLine(out.getJavaLine());
}
Modified: trunk/java/org/apache/jasper/compiler/JspUtil.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JspUtil.java 2009-12-17 17:45:16 UTC (rev 1350)
+++ trunk/java/org/apache/jasper/compiler/JspUtil.java 2010-01-04 16:32:17 UTC (rev 1351)
@@ -463,6 +463,8 @@
c = float.class;
else if ("double".equals(type))
c = double.class;
+ else if ("void".equals(type))
+ c = void.class;
else if (type.indexOf('[') < 0)
c = loader.loadClass(type);
Modified: trunk/java/org/apache/jasper/compiler/Validator.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/Validator.java 2009-12-17 17:45:16 UTC (rev 1350)
+++ trunk/java/org/apache/jasper/compiler/Validator.java 2010-01-04 16:32:17 UTC (rev 1351)
@@ -1128,6 +1128,14 @@
expectedType = "java.lang.Object";
}
}
+ if ("void".equals(expectedType)) {
+ // Can't specify a literal for a
+ // deferred method with an expected type
+ // of void - JSP.2.3.4
+ err.jspError(n,
+ "jsp.error.literal_with_void",
+ tldAttrs[j].getName());
+ }
if (tldAttrs[j].isDeferredValue()) {
// The String litteral must be castable to what is declared as type
// for the attribute
Modified: trunk/java/org/apache/jasper/resources/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/jasper/resources/LocalStrings.properties 2009-12-17 17:45:16 UTC (rev 1350)
+++ trunk/java/org/apache/jasper/resources/LocalStrings.properties 2010-01-04 16:32:17 UTC (rev 1351)
@@ -338,6 +338,7 @@
jsp.error.var_and_varReader=Only one of \'var\' or \'varReader\' may be specified
jsp.error.missing_var_or_varReader=Missing \'var\' or \'varReader\' attribute
jsp.warning.bad.urlpattern.propertygroup=Bad value {0} in the url-pattern subelement in web.xml
+jsp.error.literal_with_void=A literal value was specified for attribute {0} that is defined as a deferred method with a return type of void. JSP.2.3.4 does not permit literal values in this case
jsp.error.unknown_attribute_type=Unknown attribute type ({1}) for attribute {0}.
jsp.error.coerce_to_type=Cannot coerce value ({2}) to type ({1}) for attribute {0}.
jsp.error.jspelement.missing.name=Mandatory XML-style \'name\' attribute missing
15 years