commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Semir Patel <>
Subject [JELLY, JEXL] Inconsistency in evaluation of dot separated variables
Date Fri, 03 Oct 2003 05:51:20 GMT

Coming from an Ant background, I've got a tendency to use java package
naming conventions for my variables/properties.
Example: widget.color.hue

Now, I've been using Maven alot and so far it has worked pretty well.
However, there seems to be a particular case where expression evaluation is
not as expected:

  <goal name="jelly-error">

    <!-- if expression with a non-dotted variable: abc -->
    <j:set var="abc" value="123"/>
    <j:if test="${abc != null}">
      <echo>Recognized abc is not null</echo>

    <!-- if expression with a dotted varible: a.b.c -->
    <j:set var="a.b.c" value="456"/>
    <j:if test="${a.b.c != null}">
      <!-- expression evaluates to false and never gets here -->
      <echo>Recognized a.b.c is not null"</echo>


    [echo] abc=123
    [echo] Recognized abc is not null
    [echo] a.b.c=456

As you can see, a.b.c != null did not evaluate to true.

Bug or feature?

BTW, I'm using jelly/jext shipped with Maven Beta 10.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message