velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Byron Foster (JIRA)" <...@velocity.apache.org>
Subject [jira] Updated: (VELOCITY-618) Strict property and method references
Date Wed, 01 Oct 2008 13:07:44 GMT

     [ https://issues.apache.org/jira/browse/VELOCITY-618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Byron Foster updated VELOCITY-618:
----------------------------------

    Attachment: strictPropertyAndVariable.patch

strictPropertAndVariable.patch includes the changes of patch strictPropertyRef.patch and also
enforces that variables must exist otherwise an exception is thrown. This is turned on using
the same runtime.references.strict option.  Internally variables may now be set with a NULL
value, as in #(set = $null), and not just simply removed. 

This patch also fixes the issue of #if statements being ignored because one of the sides of
the comparison is null, or non-existent.  In the latter case bad references to variables or
properties will throw an exception.  In the former case nulls can be properly compared.




> Strict property and method references
> -------------------------------------
>
>                 Key: VELOCITY-618
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-618
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>            Reporter: Byron Foster
>         Attachments: strictPropertyAndVariable.patch, strictPropertyRef.patch
>
>
> The given patch against trunk adds a new option 'runtime.references.strict'.  When set
to true, invalid property references will throw a InvalidMethodException.  For example $foo.bar
will throw an exception if the object contained in $foo has no such property as bar.  Any
kind of reference to bar will cause an exception including:
> #if(#foo.bar)
> #set($foo.bar = "junk")
> #set($foo.getBar())
> etc...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


Mime
View raw message