You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2011/04/21 14:14:08 UTC

svn commit: r1095671 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: dom/PSVIElementNSImpl.java impl/xs/ElementPSVImpl.java

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: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org