You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ji...@codehaus.org on 2003/10/25 09:40:06 UTC

[jira] Commented: (JELLY-78) Null variables are passed over by scope inheritance

The following comment has been added to this issue:

     Author: Robert McIntosh
    Created: Sat, 25 Oct 2003 2:39 AM
       Body:
This brings up the subject of scopes in general. Back in march I started a thread, which didn't go very far, on implementing scopes in Jelly. I still have some of this code and would gladly take a another look at it and contribute it.

Here is the thread:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apache.org&msgId=682724

Robert Mc.
---------------------------------------------------------------------
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
   Fix Fors:
             1.0-beta-4

   Assignee: 
   Reporter: Scott Howlett

    Created: Tue, 26 Aug 2003 2:08 PM
    Updated: Tue, 9 Sep 2003 10:08 AM

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


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