commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Commented: (JELLY-78) Null variables are passed over by scope inheritance
Date Fri, 27 Aug 2004 05:45:20 GMT
The following comment has been added to this issue:

     Author: Scott Howlett
    Created: Thu, 26 Aug 2004 10:44 PM
A minor nit perhaps, but if variables.get(name) returns non-null, then I don't think you need
to check again to see if the variable was defined. The definedHere line could be changed to
something like:

boolean definedHere = result != null || variables.containsKey(name);

for a little performance improvement.

View this comment:

View the issue:

Here is an overview of the issue:
        Key: JELLY-78
    Summary: Null variables are passed over by scope inheritance
       Type: Bug

     Status: Open
   Priority: Minor

    Project: jelly
             core / taglib.core
   Fix Fors:

   Assignee: dion gillard
   Reporter: Scott Howlett

    Created: Tue, 26 Aug 2003 2:08 PM
    Updated: Thu, 26 Aug 2004 10:44 PM

If I explicitly assign variable foo a null value in the current scope but it has a value in
some parent scope, findVariable() will bypass the null value in favor of the non-null value
up the chain.

This is because JellyContext.getVariable & findVariable just test the result of variables.get(name)
against null instead of also checking with containsKey like this:

       Object value = variables.get(name);
       if ( value == null
         && !variables.containsKey(name)
         && isInherit() ) {


Perhaps this is an explicit design decision, but I thought it was worth mentioning.

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message