< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSConstraints.java

Print this page

        

*** 1,8 **** /* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. ! * @LastModified: Oct 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. --- 1,8 ---- /* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. ! * @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,185 **** if (base == SchemaGrammar.fAnyType) base = SchemaGrammar.fAnySimpleType; else return false; } ! return checkSimpleDerivation((XSSimpleType)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); } /** * Note: this will be a private method, and it assumes that derived is not * anySimpleType, and base is not anyType. Another method will be --- 163,184 ---- if (base == SchemaGrammar.fAnyType) base = SchemaGrammar.fAnySimpleType; else return false; } ! 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(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,1245 **** // 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); particleValidRestriction(particle1, dSGHandler, wildcard, null, false); } } // REVISIT: should we really just ignore original cause of this error? --- 1234,1244 ---- // 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 = children.get(i); particleValidRestriction(particle1, dSGHandler, wildcard, null, false); } } // REVISIT: should we really just ignore original cause of this error?
*** 1269,1281 **** int count2= bChildren.size(); int current = 0; label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i); for (int j = current; j<count2; j++) { ! XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j); current +=1; try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label; } --- 1268,1280 ---- int count2= bChildren.size(); int current = 0; label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = dChildren.get(i); for (int j = current; j<count2; j++) { ! XSParticleDecl particle2 = bChildren.get(j); current +=1; try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label; }
*** 1287,1297 **** 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); if (!particle2.emptiable()) { throw new XMLSchemaException("rcase-Recurse.2", null); } } --- 1286,1296 ---- 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 = bChildren.get(j); if (!particle2.emptiable()) { throw new XMLSchemaException("rcase-Recurse.2", null); } }
*** 1317,1330 **** int count2 = bChildren.size(); boolean foundIt[] = new boolean[count2]; label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i); for (int j = 0; j<count2; j++) { ! XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); if (foundIt[j]) throw new XMLSchemaException("rcase-RecurseUnordered.2", null); else --- 1316,1329 ---- int count2 = bChildren.size(); boolean foundIt[] = new boolean[count2]; label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = dChildren.get(i); for (int j = 0; j<count2; j++) { ! XSParticleDecl particle2 = bChildren.get(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); if (foundIt[j]) throw new XMLSchemaException("rcase-RecurseUnordered.2", null); else
*** 1339,1349 **** 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); if (!foundIt[j] && !particle2.emptiable()) { throw new XMLSchemaException("rcase-RecurseUnordered.2", null); } } --- 1338,1348 ---- 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 = bChildren.get(j); if (!foundIt[j] && !particle2.emptiable()) { throw new XMLSchemaException("rcase-RecurseUnordered.2", null); } }
*** 1368,1380 **** int count2 = bChildren.size(); int current = 0; label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i); for (int j = current; j<count2; j++) { ! XSParticleDecl particle2 = (XSParticleDecl)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)) --- 1367,1379 ---- int count2 = bChildren.size(); int current = 0; label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = dChildren.get(i); for (int j = current; j<count2; 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,1435 **** int count1 = dChildren.size(); int count2 = bChildren.size(); label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = (XSParticleDecl)dChildren.get(i); for (int j = 0; j<count2; j++) { ! XSParticleDecl particle2 = (XSParticleDecl)bChildren.get(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label; } catch (XMLSchemaException e) { --- 1422,1434 ---- int count1 = dChildren.size(); int count2 = bChildren.size(); label: for (int i = 0; i<count1; i++) { ! XSParticleDecl particle1 = dChildren.get(i); for (int j = 0; j<count2; j++) { ! XSParticleDecl particle2 = bChildren.get(j); try { particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler); continue label; } catch (XMLSchemaException e) {
< prev index next >