You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2025/07/10 21:13:15 UTC
(tika) branch TIKA-4453b created (now 56e96339d)
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a change to branch TIKA-4453b
in repository https://gitbox.apache.org/repos/asf/tika.git
at 56e96339d TIKA-4453 -- slight mods
This branch includes the following new commits:
new 56e96339d TIKA-4453 -- slight mods
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(tika) 01/01: TIKA-4453 -- slight mods
Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
tallison pushed a commit to branch TIKA-4453b
in repository https://gitbox.apache.org/repos/asf/tika.git
commit 56e96339dbeabb3d8c9a25fafde8f7f72fa29a75
Author: tallison <ta...@apache.org>
AuthorDate: Thu Jul 10 17:12:59 2025 -0400
TIKA-4453 -- slight mods
---
.../tika/sax/AbstractRecursiveParserWrapperHandler.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java b/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java
index 5c4294dfe..850ceb414 100644
--- a/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java
+++ b/tika-core/src/main/java/org/apache/tika/sax/AbstractRecursiveParserWrapperHandler.java
@@ -83,7 +83,9 @@ public abstract class AbstractRecursiveParserWrapperHandler extends DefaultHandl
/**
* This is called after parsing each embedded document. Override this
- * for custom behavior. This is currently a no-op.
+ * for custom behavior. This is currently a no-op aside from tracking embedded depth.
+ * <p>
+ * When overriding, make sure to call {@link #decrementEmbeddedDepth()}
*
* @param contentHandler content handler that was used on this embedded document
* @param metadata metadata for this embedded document
@@ -91,12 +93,13 @@ public abstract class AbstractRecursiveParserWrapperHandler extends DefaultHandl
*/
public void endEmbeddedDocument(ContentHandler contentHandler, Metadata metadata)
throws SAXException {
- embeddedDepth--;
+ decrementEmbeddedDepth();
}
/**
- * This is called by RecursiveMetadataContentHandlerProxy as it
- * cannot call endEmbeddedDocument().
+ * This is called by {@link #endEmbeddedDocument(ContentHandler, Metadata)}. Users
+ * overriding {@link #endEmbeddedDocument(ContentHandler, Metadata)} need to call this
+ * unless they are triggering it via <code>super.endEmbeddedDocument(contentHandler, metadata);</code>
*/
protected void decrementEmbeddedDepth() {
embeddedDepth--;