ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Jack" <aj...@TrySybase.com>
Subject RE: JXPathPropertyHelper -- error messages/bug?
Date Fri, 30 May 2003 17:33:03 GMT
That is 'cos I wasn't sure of myself, and hadn't added the bug at that
point. I then did. Thanks for referencing it.

Could somebody with commit permissions take a moment to review the fix I
posted (a part-of-one-liner) and commit it?  Not that you'd taker my word
for it (I'm sure) but my fix is harmless at worst.

If I could get past this bug I might be able to replace painfully
informationless exceptions with useful error messages using:

	<property name="x" value="xpath:blah XYZ...." />
	<fail message="need to have XYZ blah blah" unless="x" />

That is, I assume, if returning the string "null" in this Helper results in
an unset property.

Thanks in advance.

regards

Adam
-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: Tuesday, May 27, 2003 11:10 PM
To: user@ant.apache.org
Subject: AW: JXPathPropertyHelper -- error messages/bug?


You have forgotten to add the Bug-ID:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20272


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Adam Jack [mailto:ajack@TrySybase.com]
> Gesendet am: Dienstag, 27. Mai 2003 20:08
> An: 'Ant Users List'
> Betreff: RE: JXPathPropertyHelper -- error messages/bug?
>
> Actually, maybe a fix is along the lines of
>
> 	if ((null==iter)||(!iter.hasNext())
>
> org.apache.tools.ant.taskdefs.optional.JXPath.java line 132:
>
>             if(iter==null){
>                 return "null";
>             }
>
> before the call to:
>
>             result += iter.next();
>
> regards
>
> Adam
> -----Original Message-----
> From: Adam Jack [mailto:ajack@trysybase.com]
> Sent: Tuesday, May 27, 2003 12:05 PM
> To: user@ant.apache.org
> Subject: JXPathPropertyHelper -- error messages/bug?
>
>
> I am working with centipede which is a heavy user of this
> property helper.
> It has entries like this:
>
>   <property name="project.src.dir"
>
> value="${jxpath:/references/module.xml/root/module/project[@na
> me=$project.na
> me]/code[@type='java/plain']/@dir}"/>
>
> If no <code element exists I get an unhelpful exception
> (below) -- without
> any context whatsoever. Is this a bug (i.e. the code ought check
> iter.hasNext before calling iter.next) -- and/or could the
> code at least
> annotate the exception with (1) property name (2) property
> 'expression'.
>
> Thanks in advance.
>
> regards
>
> Adam
>
> ------------------------------------------------------------
>
>
>    java.util.NoSuchElementException
>         at
> org.apache.commons.jxpath.ri.EvalContext.next(EvalContext.java:177)
>         at
> org.apache.commons.jxpath.ri.compiler.Expression$ValueIterator
> .next(Expressi
> on.java:175)
>         at
> org.apache.tools.ant.taskdefs.optional.JXPath$JXPathPropertyHe
> lper.getProper
> tyHook(JXPath
> .java:136)
>         at
> org.apache.tools.ant.PropertyHelper.getPropertyHook(PropertyHe
> lper.java:197)
>         at
> org.apache.tools.ant.PropertyHelper.getProperty(PropertyHelper
> .java:443)
>         at
> org.apache.tools.ant.PropertyHelper.replaceProperties(Property
> Helper.java:28
> 9)
>         at
> org.apache.tools.ant.Project.replaceProperties(Project.java:486)
>         at
> org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Runtim
> eConfigurable.
> java:310)
>         at
> org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(Runtim
> eConfigurable.
> java:266)
>         at
> org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElem
> ent.java:143)
>         at org.apache.tools.ant.Task.perform(Task.java:347)
>         at org.apache.tools.ant.Target.execute(Target.java:309)
>         at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper
> 2.java:122)
>         at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHel
> per.java:120)
>         at org.apache.tools.ant.Main.runBuild(Main.java:597)
>         at org.apache.tools.ant.Main.start(Main.java:197)
>         at org.apache.tools.ant.Main.main(Main.java:235)
> F:\data\CommonsVersion\smoke-test>
>
> --
> <http://www.try.sybase.com>
> Experience Sybase Technology ...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


Mime
View raw message