public void finishMakingDocument(Document doc) {
for (int i=0; i < receivers.length; i++) {
if (exceptions[i] != null) continue; // ignore failed factory
try {
receivers[i].finishMakingDocument((Document)currents[i]);
if (!hasRootElement[i]) throw new WellformednessException(
"Factory attempted to remove the root element");
} catch (RuntimeException e) {
onException(i, e);
}
}