clean up try/catch with autocloseable
@@ -226,17 +226,15 @@ public class HSLFExtractor extends AbstractPOIFSExtractor {
long persistId = vbaAtom.getPersistIdRef();
for (HSLFObjectData objData : ppt.getEmbeddedObjects()) {
if (objData.getExOleObjStg().getPersistId() == persistId) {
- NPOIFSFileSystem npoifsFileSystem = null;
- try {
- npoifsFileSystem = new NPOIFSFileSystem(objData.getData());
- } catch (IOException e) {
- //swallow
- }
+ try (NPOIFSFileSystem npoifsFileSystem = new NPOIFSFileSystem(objData.getData())) {
try {
OfficeParser.extractMacros(npoifsFileSystem, xhtml,
EmbeddedDocumentUtil.getEmbeddedDocumentExtractor(context));
- } catch (IOException|SAXException e) {
- //swallow
+ } catch (IOException|SAXException inner) {
+ EmbeddedDocumentUtil.recordException(inner, parentMetadata);
+ }
+ } catch (IOException e) {
+ EmbeddedDocumentUtil.recordEmbeddedStreamException(e, parentMetadata);//swallow
}
}
}
