mrdevel2002-ui opened a new pull request, #3406:
URL: https://github.com/apache/tika/pull/3406

   EnviHeaderParser and IDMLParser are registered `@TikaComponent` parsers, so 
one instance serves every parse, but both wrote per-document state onto the 
instance.
   
   EnviHeaderParser kept its `XHTMLContentHandler` and the multi-line field 
accumulator (`multiLineFieldValueList`) as fields, and the list was never 
cleared. Within one header, a second brace-delimited field (`band names = {` 
after `description = {`) comes back under the first field's key with the first 
field's lines prepended, so `envi:band.names` is never set. Across parses, the 
previous document's description is joined into the next document's first 
multi-line field: parse `envi_test_header.hdr` and then the AVIRIS header with 
one instance and the second output carries `GEO-TIFF File Imported into ENVI` 
in its content and its `envi:description`. Concurrent parses also write 
paragraphs into whichever handler was set last.
   
   IDMLParser accumulated `pageCount` and `masterSpreadCount` on the instance 
and never reset them, so the second parse of `testIndesign.idml` by the same 
instance reports `Office.PAGE_COUNT` 6 instead of 3; the existing tests did not 
see it because JUnit builds a new test instance, and so a new parser, per 
method.
   
   The handler and the accumulator are now locals passed through `readLines` 
and `writeParagraphAndSetMetadata`, the accumulator is cleared when a field 
completes, and the IDML counts live in a per-parse `PageCounts` holder threaded 
through the zip handlers. Output for headers with a single multi-line field, 
which is what both fixtures have, is unchanged. The new tests fail on main 
(`GEO-TIFF File Imported into ENVI unexpectedly found`, `expected: <3> but was: 
<6>`) and pass here; `clean install` of both modules (tests, checkstyle, 
spotless, forbidden-apis) is green.
   
   There is no JIRA issue for this yet; I will open one and add the `TIKA-XXXX` 
prefix to the title and commit if you would like it tracked.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to