Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
3.0
-
None
Description
In jexl2 this code correctly outputs the line:
null
JexlEngine jexl = new JexlEngine(); Record r = new Record(); r.setHeader(new RecordHeader()); JexlContext jc = new MapContext(); jc.set("r", r ); jc.set("com.s.objects.record.RecordUtils", com.s.objects.record.RecordUtils.class ); Expression e = jexl.createExpression( "com.s.objects.record.RecordUtils.getHeaderAgeOrResolveItFromDOB(r)" ); System.out.println( e.evaluate(jc) );
The signature of the method getHeaderAgeOrResolveItFromDOB() is:
public static Integer getHeaderAgeOrResolveItFromDOB( final Record rec ) { ... }
But in jexl3 this code produces:
class com.s.objects.record.RecordUtils
JexlEngine jexl = new JexlBuilder().create(); Record r = new Record(); r.setHeader(new RecordHeader()); JexlContext jc = new MapContext(); jc.set("r", r ); jc.set("com.s.objects.record.RecordUtils", com.s.objects.record.RecordUtils.class ); JexlExpression e = jexl.createExpression( "com.s.objects.record.RecordUtils.getHeaderAgeOrResolveItFromDOB(r)" ); System.out.println( e.evaluate(jc) );
So it returns the class of the utility rather than the value null! For non null values it returns the proper type (Integer);
I think jexl3 version 3.0 was not really ready for prime time.
I really screwed up my project upgrading to 3.0.
When do you guys anticipate to release 3.1?
Is there a way to work with a snapshot after this fix?