Hi Dion,
Thanks for your quick response!
Here's a small test program that exhibits the size problem.
import java.io.*; import org.apache.commons.jexl.*; import java.util.*;
public class JexlTest {
public static class Product {
public Product() {
}
public int getSize() {
return 1;
}
}
public static void main(String[] args) throws
Exception
{
JexlContext context = JexlHelper.createContext();
context.getVars().put("p", new Product());
System.out.println(ExpressionFactory.createExpression("p.getSize()").evaluate(context));
System.out.println(ExpressionFactory.createExpression("p.size").evaluate(context));
}
}
The two expressions should be equivalent I think, but the second results in the following exception:
Exception in thread "main" org.apache.commons.jexl.parser.ParseException: Encountered ";" at line 1, column 7.
Was expecting:
"(" ...
at org.apache.commons.jexl.parser.Parser.generateParseException(Parser.java:3274)
at org.apache.commons.jexl.parser.Parser.jj_consume_token(Parser.java:3158)
at org.apache.commons.jexl.parser.Parser.SizeMethod(Parser.java:1864)
at org.apache.commons.jexl.parser.Parser.Reference(Parser.java:1912)
at org.apache.commons.jexl.parser.Parser.PrimaryExpression(Parser.java:1345)
at org.apache.commons.jexl.parser.Parser.UnaryExpression(Parser.java:1325)
at org.apache.commons.jexl.parser.Parser.MultiplicativeExpression(Parser.java:1046)
at org.apache.commons.jexl.parser.Parser.AdditiveExpression(Parser.java:970)
at org.apache.commons.jexl.parser.Parser.RelationalExpression(Parser.java:726)
at org.apache.commons.jexl.parser.Parser.EqualityExpression(Parser.java:594)
at org.apache.commons.jexl.parser.Parser.AndExpression(Parser.java:554)
at org.apache.commons.jexl.parser.Parser.ExclusiveOrExpression(Parser.java:514)
at org.apache.commons.jexl.parser.Parser.InclusiveOrExpression(Parser.java:474)
at org.apache.commons.jexl.parser.Parser.ConditionalAndExpression(Parser.java:398)
at org.apache.commons.jexl.parser.Parser.ConditionalOrExpression(Parser.java:322)
at org.apache.commons.jexl.parser.Parser.Expression(Parser.java:262)
at org.apache.commons.jexl.parser.Parser.ExpressionExpression(Parser.java:1548)
at org.apache.commons.jexl.parser.Parser.Statement(Parser.java:1522)
at org.apache.commons.jexl.parser.Parser.JexlScript(Parser.java:58)
at org.apache.commons.jexl.parser.Parser.parse(Parser.java:17)
at org.apache.commons.jexl.ExpressionFactory.createNewExpression(ExpressionFactory.java:116)
at org.apache.commons.jexl.ExpressionFactory.createExpression(ExpressionFactory.java:94)
at JexlTest.main(JexlTest.java:22)
Dion Gillard wrote:
On Tue, 24 Aug 2004 10:52:28 +0900, Geoff Waggott <[EMAIL PROTECTED]> wrote:
[snip]Hi,
I've just tested these using the latest binary drop 2004/08/23. For some
reason the jar file in this distribution is still labelled as beta-1,
whereas the javadoc on the web site is for beta-3. Where do I obtain a
beta-3 distribution to test against?
Hi Geoff,
if you've grabbed the nightly binary build, the beta-1 label is a misnomer. It really is beta3.
I'm fixing that now too.
That clears that up then :-)
Thanks again,
Geoff
-- =========================================================== Geoff Waggott <[EMAIL PROTECTED]> ZergSoft Tel: (052) 930-7790 FAX: (052) 930-7791 email: [EMAIL PROTECTED] www.zergsoft.com ===========================================================
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
