This is an automated email from the ASF dual-hosted git repository.
tilman pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/main by this push:
new 61943b664 TIKA-4290: refactor to use jdk11 feature
61943b664 is described below
commit 61943b664b57efec29ae7f2d21449ea1893812ae
Author: Tilman Hausherr <[email protected]>
AuthorDate: Thu Sep 12 09:26:54 2024 +0200
TIKA-4290: refactor to use jdk11 feature
---
tika-core/src/main/java/org/apache/tika/Tika.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tika-core/src/main/java/org/apache/tika/Tika.java
b/tika-core/src/main/java/org/apache/tika/Tika.java
index 2f17de645..5d121e6d0 100644
--- a/tika-core/src/main/java/org/apache/tika/Tika.java
+++ b/tika-core/src/main/java/org/apache/tika/Tika.java
@@ -521,8 +521,8 @@ public class Tika {
WriteOutContentHandler handler = new WriteOutContentHandler(maxLength);
ParseContext context = new ParseContext();
context.set(Parser.class, parser);
- try (InputStream autoCloseStream = stream) {
- parser.parse(autoCloseStream, new BodyContentHandler(handler),
metadata, context);
+ try (stream) {
+ parser.parse(stream, new BodyContentHandler(handler), metadata,
context);
} catch (SAXException e) {
if (!WriteLimitReachedException.isWriteLimitReached(e)) {
// This should never happen with BodyContentHandler...