Maven 1

<if test="${empty var}> fails if variable contains "." character

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-beta-9
  • Fix Version/s: 1.1-beta-1
  • Component/s: jelly/ant integration
  • Labels:
    None
  • Environment:
    Win2K, Sun JDK 1.4.1_01
  • Number of attachments :
    0

Description

Setting a variable called "a" to a value and then testing it to see if it is empty works as expected (i.e. the variable is NOT empty). If the variable is called "a.b" - i.e. contains a "." character - then the "empty" test will fail. This maven.xml file demonstrates what I mean - in my environment it reports "single" as NOT being empty, but "two.levels" as being empty.

<project
default="tag:test-empty"
xmlns:j="jelly:core">

<goal name="tag:test-empty">
<j:set var="single" value="${1 == 1}"/>
Maven says single = ${single}.
Is single empty? Maven says [${empty single}].
<echo message="Flush output"/>
<j:set var="two.levels" value="${1 == 1}"/>
Maven says two.levels = ${two.levels}.
Is two.levels empty? Maven says [${empty two.levels}].
<echo message="Flush output"/>
</goal>
</project>

Activity

Hide
dion gillard added a comment -

bloody jexl

Show
dion gillard added a comment - bloody jexl
Hide
Brett Porter added a comment -

fixed in 1.1 by upgrading to jexl 1.0 / jelly 1.0-beta-4

Show
Brett Porter added a comment - fixed in 1.1 by upgrading to jexl 1.0 / jelly 1.0-beta-4

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: