[jbosstools-issues] [JBoss JIRA] (JBIDE-9932) Fix VpeDomMapping.getNodeMappingAtVisualNode to use HashMap.get instead of iteration

Denis Maliarevich (Issue Comment Edited) (JIRA) jira-events at lists.jboss.org
Fri Dec 2 03:20:42 EST 2011


    [ https://issues.jboss.org/browse/JBIDE-9932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12647436#comment-12647436 ] 

Denis Maliarevich edited comment on JBIDE-9932 at 12/2/11 3:20 AM:
-------------------------------------------------------------------

I've noticed one more thing:
in VpeDomMapping the mapping procedure itsels puts 
1) source node with its mapping to one HashMap
2) visual node with its mapping to another HashMap.
Though putting the same *source* node in the map will override the old value, 
the visual node won't be equal to the oldest one, and will not be overridden.
Thus "registerNodes(elementMapping);" is preferred to call only once for each node.

As a solution I'm thinkig that:
registerNodes(..) should be called in "createNode(..)" method and then visual node should be updated to the new one which has been registered in the DOM(in "addNode(..)" method).
Will try it.
                
      was (Author: dmaliarevich):
    I've noticed one more thing:
in VpeDomMapping the mapping procedure itsels puts 
1) source node with its mapping to one HashMap
2) visual node with its mapping to another HashMap.
Though putting the same *source* node in the map will override the old value, 
the visual node won't be equal to the oldest one, and will not override.
Thus "registerNodes(elementMapping);" is preferred to call only once for each node.

As a solution I'm thinkig that:
registerNodes(..) should be called in "createNode(..)" method and then visual node should be updated to the new one which has been registered in the DOM(in "addNode(..)" method).
Will try it.
                  
> Fix VpeDomMapping.getNodeMappingAtVisualNode to use HashMap.get instead of iteration
> ------------------------------------------------------------------------------------
>
>                 Key: JBIDE-9932
>                 URL: https://issues.jboss.org/browse/JBIDE-9932
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Visual Page Editor core
>    Affects Versions: 3.3.0.M4
>            Reporter: Denis Golovin
>            Assignee: Denis Maliarevich
>             Fix For: 3.3.0.M5
>
>         Attachments: JBIDE-9932-Draft1.patch, JBIDE-9932-Draft2-wTests.patch
>
>
> nsIDOMNode.appendChild(nsIDOMNode child) actually adds copy of child provided and returns it as result. VPE saves in map a child passed as parameter instead of actually added node returned from appendChild method.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list