fix simple content restriction to store list of more descriptive type
git-svn-id: https://svn.apache.org/repos/asf/webservices/commons/trunk/modules/XmlSchema@1021427 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java b/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java
index ca3df58..5f972e8 100644
--- a/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java
+++ b/src/main/java/org/apache/ws/commons/schema/XmlSchemaSimpleContentRestriction.java
@@ -37,7 +37,7 @@
* Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef. Collection of attributes for the simple
* type.
*/
- private List<XmlSchemaAnnotated> attributes;
+ private List<XmlSchemaAttributeOrGroupRef> attributes;
/* Derived from the type specified by the base value. */
private XmlSchemaSimpleType baseType;
@@ -55,7 +55,7 @@
*/
public XmlSchemaSimpleContentRestriction() {
facets = Collections.synchronizedList(new ArrayList<XmlSchemaFacet>());
- attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAnnotated>());
+ attributes = Collections.synchronizedList(new ArrayList<XmlSchemaAttributeOrGroupRef>());
}
/* Allows an XmlSchemaAnyAttribute to be used for the attribute value. */
@@ -68,7 +68,7 @@
return this.anyAttribute;
}
- public List<XmlSchemaAnnotated> getAttributes() {
+ public List<XmlSchemaAttributeOrGroupRef> getAttributes() {
return this.attributes;
}
diff --git a/src/test/java/tests/SimpleContentRestrictionTest.java b/src/test/java/tests/SimpleContentRestrictionTest.java
index 69f890f..aae1dd6 100644
--- a/src/test/java/tests/SimpleContentRestrictionTest.java
+++ b/src/test/java/tests/SimpleContentRestrictionTest.java
@@ -29,8 +29,8 @@
import javax.xml.transform.stream.StreamSource;
import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaAnnotated;
import org.apache.ws.commons.schema.XmlSchemaAttribute;
+import org.apache.ws.commons.schema.XmlSchemaAttributeOrGroupRef;
import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaComplexType;
import org.apache.ws.commons.schema.XmlSchemaEnumerationFacet;
@@ -62,7 +62,7 @@
/**
* This method will test the simple content restriction.
- *
+ *
* @throws Exception Any exception encountered
*/
@Test
@@ -93,7 +93,7 @@
XmlSchemaSimpleContentRestriction xsscr = (XmlSchemaSimpleContentRestriction)xssc.getContent();
assertNotNull(xsscr);
assertEquals(new QName("http://soapinterop.org/types", "drinksize"), xsscr.getBaseTypeName());
- List<XmlSchemaAnnotated> xsoc = xsscr.getAttributes();
+ List<XmlSchemaAttributeOrGroupRef> xsoc = xsscr.getAttributes();
assertNotNull(xsoc);
assertEquals(2, xsoc.size());
@@ -105,7 +105,7 @@
String name = xsa.getName();
if ("units".equals(name)) {
assertEquals(new QName("http://soapinterop.org/types", "units"), xsa.getQName());
- assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"),
+ assertEquals(new QName("http://www.w3.org/2001/XMLSchema", "string"),
xsa.getSchemaTypeName());
assertNull(xsa.getDefaultValue());
assertEquals("required", xsa.getUse().toString());