2 Replies Latest reply: Jan 26, 2011 9:05 AM by Jesper Pedersen RSS


Stefano Maestri Expert

Hi all,


I've implemented and provided unit tests for https://issues.jboss.org/browse/JBJCA-263

I've not yet committed on our svn repo, because I've provided 2 different implementations and I'd like to know which one do you prefer before commiting one of them. Basically The first version, just leave the ${...} untouched if the xml file contain a ${...} variable not having corresponding System property set.  The second one throw an Exception . I strongly prefer the second solution

Anyway sometimes code and unit tests tell much more than word, so here you have the 2 versions:


https://github.com/maeste/IronJacamar (leave untouched)


https://github.com/maeste/IronJacamar/tree/alternativeJBJCA-263 (exception)




  • 1. JBJCA-263
    Jeff Zhang Newbie

    Hi Stefano,


    Or we can provide a third one?

    ---- quote from freemarker document http://freemarker.sourceforge.net/fmVsVel.html

    • When you try to access an undefined variable, FreeMarker will not accept that silently.        You can configure FreeMarker to stop template rendering with an error message, or skip the wrong part.        In either case, FreeMarker will log the problem, so it does not remain hidden.


    Just FYI


  • 2. JBJCA-263
    Jesper Pedersen Master

    I think that if a system property can't be resolved - e.g. the result of the operation is null - an exception should be thrown with a descriptive message including the element/attribute name and the expression (${my.property} f.ex.).


    Keep in mind that String based elements/attributes are special, as null would be a valid input value. These we have catch in the validation layer of the code.