Skip to content

Commit e66e83a

Browse files
authored
TIKA-4813: comment-accuracy follow-ups from the tersification review; (#3017)
1 parent c75dd35 commit e66e83a

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

tika-core/src/main/java/org/apache/tika/config/TimeoutLimits.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ public void setThrowOnDeadline(boolean throwOnDeadline) {
150150

151151
/**
152152
* Returns this instance if both timeouts are within {@code maxMillis}, otherwise a
153-
* copy with each offending timeout reduced to {@code maxMillis}.
153+
* copy with each offending timeout reduced to {@code maxMillis}. Used at trust
154+
* boundaries to cap request-supplied limits at an operator-set maximum.
154155
*/
155156
public TimeoutLimits clampedTo(long maxMillis) {
156157
if (totalTaskTimeoutMillis <= maxMillis && progressTimeoutMillis <= maxMillis) {

tika-parent/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,8 @@
17661766
<!-- Skip spotless -->
17671767
<spotless.apply.skip>true</spotless.apply.skip>
17681768
<spotless.check.skip>true</spotless.check.skip>
1769+
<!-- Skip rat -->
1770+
<rat.skip>true</rat.skip>
17691771
</properties>
17701772
</profile>
17711773

tika-parsers/tika-parsers-ml/tika-parser-tess4j-module/src/main/java/org/apache/tika/parser/ocr/tess4j/Tess4JParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,8 @@ private void returnTesseract(Tesseract tesseract) {
379379
* {@code tesseract} until doOCR returns on its own. {@code settled} arbitrates the pool
380380
* return in that case: giver-upper and worker race to CAS it {@code false -> true}, and
381381
* the loser -- the second to arrive -- returns the instance, so it goes back exactly
382-
* once. On a normal return or {@link TesseractException} the worker already finished,
383-
* neither side touched {@code settled}, and the caller retains ownership.
382+
* once. On a normal return or {@link TesseractException} the waiter never gave up, so
383+
* the worker's CAS wins and it skips the pool return -- the caller retains ownership.
384384
*/
385385
private String doOCRWithTimeout(Tesseract tesseract, BufferedImage image, long requestedMillis,
386386
ParseContext parseContext)

tika-server/tika-server-standard/src/test/java/org/apache/tika/server/standard/MetadataResourceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,10 @@ public void testMetaAgreesWithRmeta() throws Exception {
312312
for (String name : container.names()) {
313313
// tk:content is absent from both (ignore handler); embedded-only bookkeeping
314314
// differs because /meta stops at the container; tk:resource-name/tk:source-path
315-
// carry the server's per-request spool filename, so they differ by construction.
316-
if (name.startsWith("X-TIKA:EXCEPTION") || name.equals("tk:content")
315+
// carry the server's per-request spool filename, so they differ by
316+
// construction until that is fixed.
317+
if (name.startsWith(TikaCoreProperties.TIKA_META_EXCEPTION_PREFIX)
318+
|| name.equals("tk:content")
317319
|| name.startsWith("tk:parsed-by-full-set")
318320
|| name.equals("tk:resource-name") || name.equals("tk:source-path")
319321
|| name.equals("tk:parse-time-millis")) {

0 commit comments

Comments
 (0)