tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Boynes <jboy...@apache.org>
Subject Re: [taglibs] Null handling in Functions
Date Tue, 06 Jul 2010 15:20:10 GMT
IMO they would not help either users or developers much as this is not an contract used by
anyone other than the container. They would supplement the documentation but we would still
want that to explain why a null would not be passed.

What environment to support deserves its own thread :)

On Jul 5, 2010, at 11:58 PM, Henri Yandell wrote:

> With Tomcat 7 now out, it's tempting to focus on Taglibs in that space
> rather than worrying about JavaEE5.
> 
> Does it do much for the user to add the annotations? Does it do much
> for us on the development side?
> 
> On Mon, Jul 5, 2010 at 12:17 AM, Jeremy Boynes <jboynes@apache.org> wrote:
>> I work on a patch to remove them and add JavaDoc.
>> 
>> What do you think of adding JSR-303 javax.validation annotations like NotNull? Those
are part of JavaEE 6 so are guaranteed to be available there but would require a dependency
for a JavaEE5 environment. My thought would be not to use them yet.
>> 
>> Jeremy
>> 
>> On Jul 4, 2010, at 11:36 PM, Henri Yandell wrote:
>> 
>>> Agreed on 1.18.2. For String params (and Number, Character and
>>> Boolean) it looks like Functions should be able to assume that they're
>>> null-safe.
>>> 
>>> Hen
>>> 
>>> On Sun, Jul 4, 2010 at 12:20 PM, Jeremy Boynes <jboynes@apache.org> wrote:
>>>> Different methods in our Functions implementation handle null parameters
inconsistently; for example, toUpperCase does not perform any null check whereas indexOf does.
If I grok the EL spec correctly, all String parameter values should be coerced by the rules
in 1.18.2 which would guarantee that nulls are converted to "" and hence the null checks in
the implementation are redundant. I confirmed that  the EL implementation in Tomcat 7 [1]
does this.
>>>> 
>>>> My thought would be to remove them and rely on the JSP Engine to coerce correctly.
If this isn't safe then we should add similar checks to the other methods.
>>>> 
>>>> Thoughts?
>>>> Thanks
>>>> Jeremy
>>>> 
>>>> [1] http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/el/lang/ELSupport.java?view=markup#l405
called from AstFunction#getValue
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>> 
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


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


Mime
View raw message