while (freeSchemaValidatorIndex >= 0) {
// return first available validator
SoftReference ref = schemaValidators[freeSchemaValidatorIndex];
RevalidationHandlerHolder holder = (RevalidationHandlerHolder) ref.get();
if (holder != null && holder.handler != null) {
RevalidationHandler val = holder.handler;
holder.handler = null;
--freeSchemaValidatorIndex;
return val;
}
schemaValidators[freeSchemaValidatorIndex--] = null;
}
return (RevalidationHandler) (ObjectFactory
.newInstance(
"org.apache.xerces.impl.xs.XMLSchemaValidator",
ObjectFactory.findClassLoader(),
true));
}
else if(schemaType == XMLGrammarDescription.XML_DTD) {
// return an instance of XML11DTDValidator
if ("1.1".equals(xmlVersion)) {
while (freeXML11DTDValidatorIndex >= 0) {
// return first available validator
SoftReference ref = xml11DTDValidators[freeXML11DTDValidatorIndex];
RevalidationHandlerHolder holder = (RevalidationHandlerHolder) ref.get();
if (holder != null && holder.handler != null) {
RevalidationHandler val = holder.handler;
holder.handler = null;
--freeXML11DTDValidatorIndex;
return val;
}
xml11DTDValidators[freeXML11DTDValidatorIndex--] = null;
}
return (RevalidationHandler) (ObjectFactory
.newInstance(
"org.apache.xerces.impl.dtd.XML11DTDValidator",
ObjectFactory.findClassLoader(),
true));
}
// return an instance of XMLDTDValidator
else {
while (freeXML10DTDValidatorIndex >= 0) {
// return first available validator
SoftReference ref = xml10DTDValidators[freeXML10DTDValidatorIndex];
RevalidationHandlerHolder holder = (RevalidationHandlerHolder) ref.get();
if (holder != null && holder.handler != null) {
RevalidationHandler val = holder.handler;
holder.handler = null;
--freeXML10DTDValidatorIndex;
return val;
}
xml10DTDValidators[freeXML10DTDValidatorIndex--] = null;