public static void disposeDocument(Document old) {
for (Iterator it = old.getFields().iterator(); it.hasNext(); ) {
Fieldable f = (Fieldable) it.next();
try {
if (f.readerValue() != null) {
f.readerValue().close();
} else if (f instanceof LazyTextExtractorField) {
LazyTextExtractorField field = (LazyTextExtractorField) f;
field.dispose();
}
} catch (IOException ex) {