svn commit: r788710 - /lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/xml/impl/NamedXmlNodeImpl.java
[email protected] Fri, 26 Jun 2009 14:11:05 -0000
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) {