Author: bimargulies Date: Thu Oct 14 02:20:05 2010 New Revision: 1022358 URL: http://svn.apache.org/viewvc?rev=1022358&view=rev Log: relax check we can't really get away with imposing
Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java?rev=1022358&r1=1022357&r2=1022358&view=diff ============================================================================== --- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java (original) +++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaComplexType.java Thu Oct 14 02:20:05 2010 @@ -165,5 +165,4 @@ public class XmlSchemaComplexType extend XmlSchemaParticle getParticleType() { return particleType; } - } Modified: webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java?rev=1022358&r1=1022357&r2=1022358&view=diff ============================================================================== --- webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java (original) +++ webservices/commons/trunk/modules/XmlSchema/src/main/java/org/apache/ws/commons/schema/XmlSchemaType.java Thu Oct 14 02:20:05 2010 @@ -80,8 +80,8 @@ public abstract class XmlSchemaType exte return super.toString() + "[{}" + getName() + "]"; } else { - return super.toString() - + "[{" + namedDelegate.getParent().getLogicalTargetNamespace() + "}" + return super.toString() + + "[{" + namedDelegate.getParent().getLogicalTargetNamespace() + "}" + getName() + "]"; } } @@ -107,6 +107,14 @@ public abstract class XmlSchemaType exte } public void setName(String name) { + /* + * Inside a redefine, a 'non-top-level' type can have a name. + * This requires us to tolerate this case (non-top-level, named) even it + * in any other case it's completely invalid. + */ + if (isTopLevel() && name == null) { + throw new XmlSchemaException("A non-top-level type may not be anonyous."); + } if (namedDelegate.isTopLevel() && namedDelegate.getName() != null) { namedDelegate.getParent().getSchemaTypes().remove(getQName()); }