Author: mrglavas
Date: Thu Apr 21 12:14:07 2011
New Revision: 1095671
URL: http://svn.apache.org/viewvc?rev=1095671&view=rev
Log:
To be consistent with the rest of the XML Schema API we should be returning an
empty list instead of null when there are no inherited attributes.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java?rev=1095671&r1=1095670&r2=1095671&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/dom/PSVIElementNSImpl.java
Thu Apr 21 12:14:07 2011
@@ -24,6 +24,7 @@ import java.io.ObjectOutputStream;
import org.apache.xerces.impl.dv.ValidatedInfo;
import org.apache.xerces.impl.xs.ElementPSVImpl;
+import org.apache.xerces.impl.xs.util.ObjectListImpl;
import org.apache.xerces.impl.xs.util.StringListImpl;
import org.apache.xerces.xs.ElementPSVI;
import org.apache.xerces.xs.ItemPSVI;
@@ -273,10 +274,14 @@ public class PSVIElementNSImpl extends E
/**
* Inherited attributes.
*
- * @return inherited attributes list. null if no inherited attributes
were found.
+ * @return inherited attributes list, or an empty list
+ * if there are no inherited attributes.
*/
public ObjectList getInheritedAttributes() {
- return fInheritedAttributes;
+ if (fInheritedAttributes != null) {
+ return fInheritedAttributes;
+ }
+ return ObjectListImpl.EMPTY_LIST;
}
/**
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java
URL:
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java?rev=1095671&r1=1095670&r2=1095671&view=diff
==============================================================================
---
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java
(original)
+++
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/ElementPSVImpl.java
Thu Apr 21 12:14:07 2011
@@ -18,6 +18,7 @@
package org.apache.xerces.impl.xs;
import org.apache.xerces.impl.dv.ValidatedInfo;
+import org.apache.xerces.impl.xs.util.ObjectListImpl;
import org.apache.xerces.impl.xs.util.StringListImpl;
import org.apache.xerces.xs.ElementPSVI;
import org.apache.xerces.xs.ItemPSVI;
@@ -325,10 +326,14 @@ public class ElementPSVImpl implements E
/**
* Inherited attributes.
*
- * @return inherited attributes list. null if no inherited attributes
were found.
+ * @return inherited attributes list, or an empty list
+ * if there are no inherited attributes.
*/
public ObjectList getInheritedAttributes() {
- return fInheritedAttributes;
+ if (fInheritedAttributes != null) {
+ return fInheritedAttributes;
+ }
+ return ObjectListImpl.EMPTY_LIST;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]