[jboss-cvs] jboss-seam/src/main/org/jboss/seam/actionparam ...
Stan Silvert
ssilvert at jboss.com
Fri Nov 17 17:21:04 EST 2006
User: ssilvert
Date: 06/11/17 17:21:04
Modified: src/main/org/jboss/seam/actionparam
MethodExpressionParser.java
Log:
http://jira.jboss.com/jira/browse/JBSEAM-494
Revision Changes Path
1.2 +13 -1 jboss-seam/src/main/org/jboss/seam/actionparam/MethodExpressionParser.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MethodExpressionParser.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/actionparam/MethodExpressionParser.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- MethodExpressionParser.java 9 Aug 2006 20:30:08 -0000 1.1
+++ MethodExpressionParser.java 17 Nov 2006 22:21:04 -0000 1.2
@@ -133,7 +133,8 @@
public boolean isParamExpression()
{
- return (!isStringLiteral(this.unparsedExpression)) && hasParamsInExpression();
+ return (!isStringLiteral(this.unparsedExpression)) &&
+ (hasParamsInExpression() || hasNoArgParens(this.unparsedExpression));
}
//---------- Static methods used for parsing ---------------------------------
@@ -217,6 +218,17 @@
return !expression.substring(openParen + 1, closeParen).trim().equals("");
}
+ // expects full expression
+ // see if expression contains a no-arg method call
+ private static boolean hasNoArgParens(String expression)
+ {
+ int openParen = expression.indexOf('(');
+ int closeParen = expression.lastIndexOf(')');
+
+ if ( (openParen == -1) || (closeParen == -1) ) return false;
+ return expression.substring(openParen + 1, closeParen).trim().equals("");
+ }
+
// extract each param
private static String[] getParams(String exp)
{
More information about the jboss-cvs-commits
mailing list