< prev index next >
src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java
Print this page
@@ -1,8 +1,8 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
- * @LastModified: Oct 2017
+ * @LastModified: Nov 2017
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -163,23 +163,22 @@
if (base == SchemaGrammar.fAnyType)
base = SchemaGrammar.fAnySimpleType;
else
return false;
}
- return checkSimpleDerivation((XSSimpleType)derived,
- (XSSimpleType)base, block);
+ return checkSimpleDerivation(derived, (XSSimpleType)base, block);
}
/**
* check whether complex type derived is valid derived from base,
* given a subset of {restriction, extension}.
*/
public static boolean checkComplexDerivationOk(XSComplexTypeDecl derived, XSTypeDefinition base, short block) {
// if derived is anyType, then it's valid only if base is anyType too
if (derived == SchemaGrammar.fAnyType)
return derived == base;
- return checkComplexDerivation((XSComplexTypeDecl)derived, base, block);
+ return checkComplexDerivation(derived, base, block);
}
/**
* Note: this will be a private method, and it assumes that derived is not
* anySimpleType, and base is not anyType. Another method will be
@@ -1235,11 +1234,11 @@
// Check that each member of the group is a valid restriction of the wildcard
int count = children.size();
try {
for (int i = 0; i < count; i++) {
- XSParticleDecl particle1 = (XSParticleDecl)children.get(i);
+ XSParticleDecl particle1 = children.get(i);
particleValidRestriction(particle1, dSGHandler, wildcard, null, false);
}
}
// REVISIT: should we really just ignore original cause of this error?
@@ -1269,13 +1268,13 @@
int count2= bChildren.size();
int current = 0;
label: for (int i = 0; i<count1; i++) {
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+ XSParticleDecl particle1 = dChildren.get(i);
for (int j = current; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+ XSParticleDecl particle2 = bChildren.get(j);
current +=1;
try {
particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
continue label;
}
@@ -1287,11 +1286,11 @@
throw new XMLSchemaException("rcase-Recurse.2", null);
}
// Now, see if there are some elements in the base we didn't match up
for (int j=current; j < count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+ XSParticleDecl particle2 = bChildren.get(j);
if (!particle2.emptiable()) {
throw new XMLSchemaException("rcase-Recurse.2", null);
}
}
@@ -1317,14 +1316,14 @@
int count2 = bChildren.size();
boolean foundIt[] = new boolean[count2];
label: for (int i = 0; i<count1; i++) {
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+ XSParticleDecl particle1 = dChildren.get(i);
for (int j = 0; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+ XSParticleDecl particle2 = bChildren.get(j);
try {
particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
if (foundIt[j])
throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
else
@@ -1339,11 +1338,11 @@
throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
}
// Now, see if there are some elements in the base we didn't match up
for (int j=0; j < count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+ XSParticleDecl particle2 = bChildren.get(j);
if (!foundIt[j] && !particle2.emptiable()) {
throw new XMLSchemaException("rcase-RecurseUnordered.2", null);
}
}
@@ -1368,13 +1367,13 @@
int count2 = bChildren.size();
int current = 0;
label: for (int i = 0; i<count1; i++) {
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+ XSParticleDecl particle1 = dChildren.get(i);
for (int j = current; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+ XSParticleDecl particle2 = bChildren.get(j);
current +=1;
try {
// IHR: go back one element on b list because the next element may match
// this as well.
if (particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler))
@@ -1423,13 +1422,13 @@
int count1 = dChildren.size();
int count2 = bChildren.size();
label: for (int i = 0; i<count1; i++) {
- XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i);
+ XSParticleDecl particle1 = dChildren.get(i);
for (int j = 0; j<count2; j++) {
- XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j);
+ XSParticleDecl particle2 = bChildren.get(j);
try {
particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);
continue label;
}
catch (XMLSchemaException e) {
< prev index next >