commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CONFIGURATION-396) In HierarchicalConfiguration$Node visits the ConfigurationKey points to the parent path in visitAfterChildren call
Date Sat, 26 Sep 2009 20:26:16 GMT

    [ https://issues.apache.org/jira/browse/CONFIGURATION-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12759944#action_12759944
] 

Oliver Heger commented on CONFIGURATION-396:
--------------------------------------------

You are right, resetting the key before {{visitAfterChildren()}} is inconsistent.

Changing the order of the code fragment you pointed out - so that {{visitAfterChildren()}}
is called first and then the key is reset - obviously has no negative side effect. At least,
all unit tests keep running. So I think we should change this.

One remark however: The inner {{Node}} and {{NodeVisitor}} classes of {{HierarchicalConfiguration}}
exist only for reasons of backwards compatibility. New code should use the corresponding classes
in the {{tree}} package, i.e. {{ConfigurationNode}} and {{ConfigurationNodeVisitor}}. The
{{ConfigurationNodeVisitor}} interface does not provide a configuration key. This is due to
the fact that different expression engines can be set which all can use a specific syntax
for their property keys.

> In HierarchicalConfiguration$Node visits the ConfigurationKey  points to the parent path
in visitAfterChildren call
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-396
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-396
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>            Reporter: Vasanth Amana
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When visiting a child the key is aggregated to have the child node name, and a call to
visitBeforeChildren and grandChildren's visits are made.
> However, before calling  visitAfterChildren,  the resetting of the key to that of it's
parent's, seems inconsistent.
> Last lines in visit(NodeVisitor visitor, ConfigurationKey key) 
>             if (key != null)
>             {
>                 key.setLength(length);
>             }
>             visitor.visitAfterChildren(this, key);

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


Mime
View raw message