You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Henning P. Schmiedehausen" <hp...@intermeta.de> on 2003/01/06 11:46:24 UTC

[BUG] and empty strings

Hi,

ok, I'm too dumb to put a bug report into jira.werken.com. It just
offers me "commons attributes" as possible projects and I can't select
Maven.

Consider the following two code segments:

--- cut ---
<goal name="testEmptyVar1">
  <echo>${test.prop}</echo>
  <j:set var="testPropX" value="${test.prop}X"/>
  <j:if test="${testPropX == 'X'}">
    <fail>test.prop not set!</fail>
  </j:if>
</goal>
--- cut ---

--- cut ---
<goal name="testEmptyVar2">
  <echo>${test.prop}</echo>
  <j:set var="testProp" value="${test.prop}"/>
  <j:if test="${testProp == ''}">
    <fail>test.prop not set!</fail>
  </j:if>
</goal>
--- cut ---

The first one works (if test.prop is not set e.g. in my
~/build.properties , it reports "test.prop not set"), the second one
does not.

Neither does

--- cut ---
<goal name="testEmptyVar3">
  <echo>${test.prop}</echo>
  <j:set var="testProp" value="${test.prop}"/>
  <j:if test="${testProp.equals('')}">
    <fail>test.prop not set!</fail>
  </j:if>
</goal>
--- cut ---

nor

--- cut ---
<goal name="testEmptyVar4">
  <echo>${test.prop}</echo>
  <j:set var="testProp" value="${test.prop}"/>
  <j:if test="${testProp.isEmpty()}">
    <fail>test.prop not set!</fail>
  </j:if>
</goal>
--- cut ---

I do consider this a bug.


	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

Re: [BUG] and empty strings

Posted by James Strachan <ja...@yahoo.co.uk>.
From: "Henning P. Schmiedehausen" <hp...@intermeta.de>
> "James Strachan" <ja...@yahoo.co.uk> writes:
> 
> >You can use
> 
> >    ${empty(testProp)}
> 
> >which works.
> 
> >Note that null != ''
> 
> Yep. But then the ${testProp.isEmpty()} should've worked? That's how
> isEmpty() from the StringUtils work.

But if testProp is null there's no String object to invoke isEmpty() on.

James
-------
http://radio.weblogs.com/0112098/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Re: [BUG] and empty strings

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"James Strachan" <ja...@yahoo.co.uk> writes:

>You can use

>    ${empty(testProp)}

>which works.

>Note that null != ''

Yep. But then the ${testProp.isEmpty()} should've worked? That's how
isEmpty() from the StringUtils work.

	Regards
		Henning


-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

Re: [BUG] and empty strings

Posted by James Strachan <ja...@yahoo.co.uk>.
You can use

    ${empty(testProp)}

which works.

Note that null != ''

James
-------
http://radio.weblogs.com/0112098/

----- Original Message -----
From: "Henning P. Schmiedehausen" <hp...@intermeta.de>
> Hi,
>
> ok, I'm too dumb to put a bug report into jira.werken.com. It just
> offers me "commons attributes" as possible projects and I can't select
> Maven.
>
> Consider the following two code segments:
>
> --- cut ---
> <goal name="testEmptyVar1">
>   <echo>${test.prop}</echo>
>   <j:set var="testPropX" value="${test.prop}X"/>
>   <j:if test="${testPropX == 'X'}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
>
> --- cut ---
> <goal name="testEmptyVar2">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp == ''}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
>
> The first one works (if test.prop is not set e.g. in my
> ~/build.properties , it reports "test.prop not set"), the second one
> does not.
>
> Neither does
>
> --- cut ---
> <goal name="testEmptyVar3">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp.equals('')}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
>
> nor
>
> --- cut ---
> <goal name="testEmptyVar4">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp.isEmpty()}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
>
> I do consider this a bug.
>
>
> Regards
> Henning
>
> --
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
> INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de
>
> Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
> D-91054 Buckenhof     Fax.: 09131 / 50654-20
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Re: [jelly] (was Re: [BUG] and empty strings)

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
dion@multitask.com.au writes:

>I believe you need to 'log-in' to Jira to file a bug report.

Thanks for everyone telling me. I did register (I'm not _that_ dumb
=:-) ) but thought that after registration I get logged in
automatically which I didn't. Now everything is fine. Should I refile
this as a bug?

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

[jelly] (was Re: [BUG] and empty strings)

Posted by di...@multitask.com.au.
Looks like a bug in Jelly/Jexl to me.

I believe you need to 'log-in' to Jira to file a bug report.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


henning@forge.intermeta.de wrote on 06/01/2003 09:46:24 PM:

> Hi,
> 
> ok, I'm too dumb to put a bug report into jira.werken.com. It just
> offers me "commons attributes" as possible projects and I can't select
> Maven.
> 
> Consider the following two code segments:
> 
> --- cut ---
> <goal name="testEmptyVar1">
>   <echo>${test.prop}</echo>
>   <j:set var="testPropX" value="${test.prop}X"/>
>   <j:if test="${testPropX == 'X'}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> --- cut ---
> <goal name="testEmptyVar2">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp == ''}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> The first one works (if test.prop is not set e.g. in my
> ~/build.properties , it reports "test.prop not set"), the second one
> does not.
> 
> Neither does
> 
> --- cut ---
> <goal name="testEmptyVar3">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp.equals('')}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> nor
> 
> --- cut ---
> <goal name="testEmptyVar4">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp.isEmpty()}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> I do consider this a bug.
> 
> 
>    Regards
>       Henning
> 
> -- 
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
> INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de
> 
> Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
> D-91054 Buckenhof     Fax.: 09131 / 50654-20 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-maven-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-maven-dev-
> help@jakarta.apache.org>
> 

> ForwardSourceID:NT0009F162 

[jelly] (was Re: [BUG] and empty strings)

Posted by di...@multitask.com.au.
Looks like a bug in Jelly/Jexl to me.

I believe you need to 'log-in' to Jira to file a bug report.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au


henning@forge.intermeta.de wrote on 06/01/2003 09:46:24 PM:

> Hi,
> 
> ok, I'm too dumb to put a bug report into jira.werken.com. It just
> offers me "commons attributes" as possible projects and I can't select
> Maven.
> 
> Consider the following two code segments:
> 
> --- cut ---
> <goal name="testEmptyVar1">
>   <echo>${test.prop}</echo>
>   <j:set var="testPropX" value="${test.prop}X"/>
>   <j:if test="${testPropX == 'X'}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> --- cut ---
> <goal name="testEmptyVar2">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp == ''}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> The first one works (if test.prop is not set e.g. in my
> ~/build.properties , it reports "test.prop not set"), the second one
> does not.
> 
> Neither does
> 
> --- cut ---
> <goal name="testEmptyVar3">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp.equals('')}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> nor
> 
> --- cut ---
> <goal name="testEmptyVar4">
>   <echo>${test.prop}</echo>
>   <j:set var="testProp" value="${test.prop}"/>
>   <j:if test="${testProp.isEmpty()}">
>     <fail>test.prop not set!</fail>
>   </j:if>
> </goal>
> --- cut ---
> 
> I do consider this a bug.
> 
> 
>    Regards
>       Henning
> 
> -- 
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
> INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de
> 
> Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
> D-91054 Buckenhof     Fax.: 09131 / 50654-20 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-maven-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-maven-dev-
> help@jakarta.apache.org>
> 

> ForwardSourceID:NT0009F162 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>