commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@codehaus.org
Subject [jira] Commented: (JELLY-78) Null variables are passed over by scope inheritance
Date Fri, 05 Sep 2003 17:00:18 GMT
The following comment has been added to this issue:

     Author: Morgan Delagrange
    Created: Fri, 5 Sep 2003 11:58 AM
       Body:
Makes sense to me, Peter.  The presence of a removeVariable method in JellyContext seems to
imply that nulling out a variable and removing it are two distinct operations.  I'm +1 for
making the change as proposed.
---------------------------------------------------------------------
View the issue:

  http://jira.codehaus.org/secure/ViewIssue.jspa?key=JELLY-78


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

     Status: Unassigned
   Priority: Minor

 Time Spent: Unknown
  Remaining: Unknown

    Project: jelly
 Components: 
             core / taglib.core

   Assignee: 
   Reporter: Scott Howlett

    Created: Tue, 26 Aug 2003 2:08 PM
    Updated: Thu, 4 Sep 2003 4:07 PM

Description:
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.



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message