Visitar URL original
Recalculate delimiter reader mark length by efegokdemir · Pull Request #386 · apache/maven-filtering · GitHub
Skip to content

Recalculate delimiter reader mark length - #386

Merged
gnodet merged 1 commit into
apache:masterfrom
efegokdemir:codex/issue-354-delimiter-mark-length
Sep 24, 2026
Merged

gnodet merged 1 commit into
apache:masterfrom
efegokdemir:codex/issue-354-delimiter-mark-length

Conversation

@efegokdemir

Copy link
Copy Markdown
Contributor

Summary

Fixes #354 by recalculating the reader mark length whenever delimiter specifications are replaced.

Changes

  • Reuse calculateMarkLength() after clearing and parsing the current delimiter set.
  • Add a regression test that calls setDelimiterSpecs() repeatedly and verifies the mark length does not accumulate.

Testing

  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn test — PASS (76 tests).
  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn verify — PASS (76 tests; Checkstyle, Spotless and RAT passed).
  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 mvn -Prun-its verify — PASS, with Maven reporting that the repository does not define a run-its profile.
  • git diff --check — PASS.

Notes

Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct fix for the markLength accumulation bug (#354). By delegating to calculateMarkLength() (which resets the counter to 255 before re-adding all delimiter lengths) instead of accumulating on top of whatever markLength already holds, setDelimiterSpecs() is now idempotent.

✅ Pre-fix validation: test settingDelimiterSpecsRecalculatesMarkLength confirmed failing before the fix (markLength grows by 2 on every call) and passing after.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet gnodet added bug Something isn't working java Pull requests that update Java code labels Sep 24, 2026
@gnodet
gnodet merged commit c549ecc into apache:master Sep 24, 2026
8 checks passed
@github-actions github-actions Bot added this to the 4.0.0-beta-2 milestone Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working java Pull requests that update Java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setDelimiterSpecs() accumulates markLength instead of recalculating

3 participants