You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ra...@apache.org on 2006/01/16 22:30:43 UTC

svn commit: r369575 - /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java

Author: radup
Date: Mon Jan 16 13:30:40 2006
New Revision: 369575

URL: http://svn.apache.org/viewcvs?rev=369575&view=rev
Log:
Fix for XMLBEANS-236. If a schema contained a prohibited attribute and types were defined inside the attribute then scomp produced an NPE. This is fixed with this checkin.

Contributed by Lawrence Jones

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java?rev=369575&r1=369574&r2=369575&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscComplexTypeResolver.java Mon Jan 16 13:30:40 2006
@@ -1001,7 +1001,22 @@
                     }
 
                     if (sAttr.getUse() != SchemaLocalAttribute.PROHIBITED)
+                    {
                         result.addAttribute(sAttr);
+                    }
+                    else
+                    {
+                        // attribute is prohibited. If it has an anonymous type remove
+                        // it from the list (this will prevent inclusion of any anonymous
+                        // types defined within the prohibited attribute which would
+                        // otherwise attempt to refer to the prohibited attribute at
+                        // save() time)
+                        SchemaType attrType = sAttr.getType();
+                        if (anonymousTypes != null && anonymousTypes.contains(attrType))
+                        {
+                            anonymousTypes.remove(attrType);
+                        }
+                    }
 
                     if (sAttr.getDefaultText() != null && !sAttr.isFixed())
                     {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org