[jira] Issue Comment Edited: (JEXL-58) UnifiedJEXL

2009-07-16 Thread Henri Biestro (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12732154#action_12732154
 ] 

Henri Biestro edited comment on JEXL-58 at 7/16/09 3:59 PM:


introduced an abstract base class for immediate  Deferred expressions making 
code clearer -  CPD happier-.
Btw, removing whitespace rules from checkstyle (all of them because of 
generics) removed 600 errors.

Patch does not apply cleanly on ScriptFactory  ExpressionFactory :-(

  was (Author: henrib):
introduced an abstract base class for immediate  Deferred expressions 
making code clearer -  CPD happier-.
Btw, removing whitespace rules from checkstyle (all of them because of 
generics) removed 600 errors.
  
 UnifiedJEXL
 ---

 Key: JEXL-58
 URL: https://issues.apache.org/jira/browse/JEXL-58
 Project: Commons JEXL
  Issue Type: New Feature
Reporter: Henri Biestro
Assignee: Rahul Akolkar
 Fix For: 2.0

 Attachments: JEXL-58.patch, JEXL-58.patch, JEXL-58.patch, 
 JEXL-58.patch, JEXL-58.patch, JEXL-58.patch, JEXL-58.patch


  An evaluator similar to the unified EL evaluator used in JSP/JSF based on 
 JEXL.
  It is intended to be used in configuration modules, XML based frameworks or 
 JSP taglibs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (JEXL-58) UnifiedJEXL

2009-07-15 Thread Henri Biestro (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12731279#action_12731279
 ] 

Henri Biestro edited comment on JEXL-58 at 7/15/09 7:27 AM:


Thanks for the commit; I checked it  everything seems fine.

About the JexlException, the JexlEngine as it stands  in 1.0 does a lot to 
avoid throwing exceptions, using null  0 as a result when things get bad even 
when not in silent mode, and to the point of being exception-safe in all cases. 
Since no exceptions can escape, no need to declare them.
However, as pointed by JEXL-10  JEXL-11, it also makes sense to allow for some 
stricter evaluation mode (soon to be added as a new patch).
Using those specific runtime exceptions does leave the choice to users;
- those who like the lenient mode dont have to deal with exception and the 
engine does produce warnings in the logs when appropriate. This also means that 
instead of using a checked exception that is unecessary, we let JEXL recover 
from the problem.
- those who need a strict mode will want to catch  handle them since this 
mode states that such errors are not recoverable from the JEXL point of view.

But I'd rather leave the choice since JEXL is necessarily embedded deeply; not 
having to wrap exception or declare them as throwable in a lot of methods has 
its set of advantages, the least of which being to simplify the implementation 
of the outer error handling mechanisms.The more convenient it is to use, the 
better.

This also explains the warnings while running the tests btw, helpfull to 
visually check that the debugger features work; putting the jul.logger at 
error level do fix it. I'll add this in the tests setup where appropriate.


  was (Author: henrib):
Thanks for the commit; I checked it  everything seems fine.

About the JexlException, the JexlEngine as it stands  in 1.0 does a lot to 
avoid throwing exceptions, using null  0 as a result when things get bad even 
when not in silent mode, almost to the point of being failsafe in all cases. As 
pointed by JEXL-10  JEXL-11, it would make sense to allow for some stricter 
evaluation mode.
This would leave the choice to users; those who like the lenient mode dont 
have to deal with exception and the engine does produce warnings in the logs 
when appropriate and users who would like a strict mode will want to catch  
handle them.
It just did not seem necessary to keep those as checked exceptions when none 
could be thrown.

This also explains the warnings while running the tests btw (helpfull to 
visually check that the debugger features work); putting the logger in error 
should fix it.

  
 UnifiedJEXL
 ---

 Key: JEXL-58
 URL: https://issues.apache.org/jira/browse/JEXL-58
 Project: Commons JEXL
  Issue Type: New Feature
Reporter: Henri Biestro
Assignee: Rahul Akolkar
 Fix For: 2.0

 Attachments: JEXL-58.patch, JEXL-58.patch, JEXL-58.patch


  An evaluator similar to the unified EL evaluator used in JSP/JSF based on 
 JEXL.
  It is intended to be used in configuration modules, XML based frameworks or 
 JSP taglibs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (JEXL-58) UnifiedJEXL

2009-07-15 Thread Henri Biestro (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12731474#action_12731474
 ] 

Henri Biestro edited comment on JEXL-58 at 7/15/09 9:04 AM:


Implements the lenient/strict mode where null is considered an error in all 
arithmetic operators and when variables are not defined (fixes JEXL-10/JEXL-11).
The silent mode means that no JexlException will be thrown but error cases 
are logged as warn.

The setSilent/setLenient methods of a JexlEngine allow to tune it according to 
error control needs.
When silent  lenient (not-strict), 0  null should be indicators of 
default values so that even in an case of error, something meaningfull can 
still be inferred; may be convenient for configurations.
When silent  strict, one should probably consider using null as an error 
case - ie, every object manipulated by JEXL should be valued; the ternary 
operator, especially the '?:' form can be used to workaround exceptional cases. 
Use case could be configuration with no implicit values or defaults.
When not-silent  not-strict, the error control grain is roughly on par 
with JEXL 1.0
When not-silent  strict', we obtain the finest error control grain; it is 
the closest to Java code - still augmented by script capabilities regarding 
automated conversions  type matching.

Totally aside, this patch integrates the JEXL-40 fix public abstract methods 
in non public concrete derived class (recopied newer version of Velocity 
method from trunk).


  was (Author: henrib):
Implements the lenient/strict mode where null is considered an error in all 
arithmetic operators and when variables are not defined (fixes JEXL-10/JEXL-11).
Also integrates JEXL-40 fix.

After the fact, it seems one should always use setSilent()  setLenient() in 
conjunction so I'm tempted to merge the 2 concepts in one. Opinions ?
  
 UnifiedJEXL
 ---

 Key: JEXL-58
 URL: https://issues.apache.org/jira/browse/JEXL-58
 Project: Commons JEXL
  Issue Type: New Feature
Reporter: Henri Biestro
Assignee: Rahul Akolkar
 Fix For: 2.0

 Attachments: JEXL-58.patch, JEXL-58.patch, JEXL-58.patch, 
 JEXL-58.patch


  An evaluator similar to the unified EL evaluator used in JSP/JSF based on 
 JEXL.
  It is intended to be used in configuration modules, XML based frameworks or 
 JSP taglibs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (JEXL-58) UnifiedJEXL

2009-07-14 Thread Henri Biestro (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12730531#action_12730531
 ] 

Henri Biestro edited comment on JEXL-58 at 7/14/09 9:59 AM:


Besides {UnifiedJEXL,UnifiedJEXLTest}.java, the patch carries some small 
improvements especially regarding exception reporting  javadoc.

Quick notes for reviewers:
*Debugger.java:
fixed edge case in debug()

*Expression.java / ExpressionImpl.java
evaluate signature modified (does not throw)
cleaned up remnants of pre/post resolvers

*Interpreter.java
simplified import (import org.apache.commons.jexl.parser.*)
handles ArithmeticException (divide by zero)
added registers for JexlEngine.{set,get}Property
simplified constructor to use JexlEngine, JexlContext
exposed {set,get}Silent method

*JexlArithmetic.java
division by zero ignored only if JexlEngine.isSilent()

*JexlEngine.java
improved exception reporting, silent mode logs exceptions as info
ensure derivability (protected fields/methods)
added configurable expression cache
added {set,get}Property methods allowing to set/get properties from any bean 
using an expression

*AithmeticTest.java
added division by zero tests

*Paser.jjt
parsing only throws ParserException
added C style in-line comments (/*...*/)

*Other:
JEXL-32 fixed in 2.0
JEXL-21 wont be fixed but JexlArithmetic can be derived to implement this kind 
of feature
JEXL-35 JexlEngine / JexlArithmetic are the root points of extensibility

  was (Author: henrib):
Besides {UnifiedEL,UnifiedELTest}.java, the patch carries some small 
improvements especially regarding exception reporting  javadoc.

Quick notes for reviewers:
*Debugger.java:
fixed edge case in debug()

*Expression.java / ExpressionImpl.java
evaluate signature modified (does not throw)
cleaned up remnants of pre/post resolvers

*Interpreter.java
simplified import (import org.apache.commons.jexl.parser.*)
handles ArithmeticException (divide by zero)
added registers for JexlEngine.{set,get}Property
simplified constructor to use JexlEngine, JexlContext
exposed {set,get}Silent method

*JexlArithmetic.java
division by zero ignored only if JexlEngine.isSilent()

*JexlEngine.java
improved exception reporting, silent mode logs exceptions as info
ensure derivability (protected fields/methods)
added configurable expression cache
added {set,get}Property methods allowing to set/get properties from any bean 
using an expression

*AithmeticTest.java
added division by zero tests

*Paser.jjt
parsing only throws ParserException
added C style in-line comments (/*...*/)

*Other:
JEXL-32 fixed in 2.0
JEXL-21 wont be fixed but JexlArithmetic can be derived to implement this kind 
of feature
JEXL-35 JexlEngine / JexlArithmetic are the root points of extensibility
  
 UnifiedJEXL
 ---

 Key: JEXL-58
 URL: https://issues.apache.org/jira/browse/JEXL-58
 Project: Commons JEXL
  Issue Type: New Feature
Reporter: Henri Biestro
 Fix For: 2.0

 Attachments: JEXL-58.patch, JEXL-58.patch


  An evaluator similar to the unified EL evaluator used in JSP/JSF based on 
 JEXL.
  It is intended to be used in configuration modules, XML based frameworks or 
 JSP taglibs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (JEXL-58) UnifiedJEXL

2009-07-14 Thread Henri Biestro (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12731107#action_12731107
 ] 

Henri Biestro edited comment on JEXL-58 at 7/14/09 1:32 PM:


More fixes  tests (from JEXL-52 down to JEXL-42) in  IssuesTest.java.
Made silent logging to warn (was info).
Added C style comments in syntax.


  was (Author: henrib):
More fixes  tests (from JEXL-52 down to JEXL-42) in  IssuesTest.java
  
 UnifiedJEXL
 ---

 Key: JEXL-58
 URL: https://issues.apache.org/jira/browse/JEXL-58
 Project: Commons JEXL
  Issue Type: New Feature
Reporter: Henri Biestro
 Fix For: 2.0

 Attachments: JEXL-58.patch, JEXL-58.patch, JEXL-58.patch


  An evaluator similar to the unified EL evaluator used in JSP/JSF based on 
 JEXL.
  It is intended to be used in configuration modules, XML based frameworks or 
 JSP taglibs.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.