Skip to content

Commit

Permalink
TIKA-4290: refactor to use jdk11 feature
Browse files Browse the repository at this point in the history
  • Loading branch information
THausherr committed Sep 12, 2024
1 parent 78eb52a commit 61943b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tika-core/src/main/java/org/apache/tika/Tika.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ public String parseToString(InputStream stream, Metadata metadata, int maxLength
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...
Expand Down

0 comments on commit 61943b6

Please sign in to comment.