some fixed code commit

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

some fixed code commit

林佳鸿
Dear:
   In svn version 4062:
            org.directwebremoting.impl.DwrXmlConfigurator : line num 362
     ####################################################################
                 for (int j = 0; j < textNodes.getLength(); j++)
                    {
                            buffer.append(textNodes.item(j).getNodeValue());
                        }
    ####################################################################
   
    By these code we can find that the item which in textNodes does not check its node type
if org.w3c.dom.Node.TEXT_NODE.
    I think the checking is necssared, so I modify some code to commit by the maillist.
     The modified code:
  ######################################################################
           for (int j = 0; j < textNodes.getLength(); j++)
                    {
                        /**
                         *   if the node type of item which in textNodes's array
                         *is not @see org.w3c.dom.Node#TEXT_NODE , should not put
                         *it into buffer.
                         *
                         *linjiahong modify on 20140618
                         * **/
                        if(Node.TEXT_NODE == textNodes.item(j).getNodeType()) {
                            buffer.append(textNodes.item(j).getNodeValue());
                        }
                    }
###########################################################################
Yours, linjiahong
Reply | Threaded
Open this post in threaded view
|

Re: some fixed code commit

Mike Wilson
Administrator
Thanks for your suggestion and your comment makes sense. What kind of problem did you experience when running with the existing code?
 
Best regards
Mike Wilson
 
linjiahong wrote:
Dear:
   In svn version 4062:
            org.directwebremoting.impl.DwrXmlConfigurator : line num 362
     ####################################################################
                 for (int j = 0; j < textNodes.getLength(); j++)
                    {
                            buffer.append(textNodes.item(j).getNodeValue());
                        }
    ####################################################################
   
    By these code we can find that the item which in textNodes does not check its node type
if org.w3c.dom.Node.TEXT_NODE.
    I think the checking is necssared, so I modify some code to commit by the maillist.
     The modified code:
  ######################################################################
           for (int j = 0; j < textNodes.getLength(); j++)
                    {
                        /**
                         *   if the node type of item which in textNodes's array
                         *is not @see org.w3c.dom.Node#TEXT_NODE , should not put
                         *it into buffer.
                         *
                         *linjiahong modify on 20140618
                         * **/
                        if(Node.TEXT_NODE == textNodes.item(j).getNodeType()) {
                            buffer.append(textNodes.item(j).getNodeValue());
                        }
                    }
###########################################################################
Yours, linjiahong