svn commit: r788710 - /lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/xml/impl/NamedXmlNodeImpl.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Fri Jun 26 14:11:05 2009
New Revision: 788710

URL: http://svn.apache.org/viewvc?rev=788710&view=rev
Log:
Catch null local names in diff module.

Modified:
    lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/xml/impl/NamedXmlNodeImpl.java

Modified: lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/xml/impl/NamedXmlNodeImpl.java
URL: http://svn.apache.org/viewvc/lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/xml/impl/NamedXmlNodeImpl.java?rev=788710&r1=788709&r2=788710&view=diff
==============================================================================
--- lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/xml/impl/NamedXmlNodeImpl.java (original)
+++ lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/xml/impl/NamedXmlNodeImpl.java Fri Jun 26 14:11:05 2009
@@ -41,8 +41,14 @@
         NamedXmlNodeImpl otherNode = (NamedXmlNodeImpl) comparable;
         String otherNs = otherNode.getNamespaceUri();
         String ns = getNamespaceUri();
+
+        String otherLocalName = otherNode.getLocalName();
+        otherLocalName = otherLocalName == null ? "<NULL>" : otherLocalName;
+        String localName = getLocalName();
+        localName = localName == null ? "<NULL>" : localName;
+
         return ((ns == null && otherNs == null) || ns.equals(otherNs))
-                && otherNode.getLocalName().equals(getLocalName());
+                && otherLocalName.equals(localName);
     }
 
     public static final String getKey(String namespaceUri, String localName) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.