setDelimiterSpecs() accumulates markLength instead of recalculating
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java
- Domain
- build-system
Research direction
Start in src/main/java/org/apache/maven/shared/filtering/MultiDelimiterInterpolatorFilterReaderLineEnding.java, focusing on setDelimiterSpecs() and calculateMarkLength(). Trace how markLength is initialized and updated, then verify that calling setDelimiterSpecs() repeatedly recalculates from the base value rather than accumulating. Run the relevant Maven test suite and add regression coverage if the existing tests do not exercise repeated calls.
Written by the indexing model from the issue text.
Description
In src/main/java/org/apache/maven/shared/filtering/MultiDelimiterInterpolatorFilterReaderLineEnding.java, lines 133–141:
public AbstractFilterReaderLineEnding setDelimiterSpecs(Set<String> specs) {
delimiters.clear();
for (String spec : specs) {
delimiters.add(DelimiterSpecification.parse(spec));
markLength += spec.length() * 2;
}
return this;
}
markLength is accumulated on top of the current value rather than recalculated from base (255 + escapeString.length). If setDelimiterSpecs is called multiple times, markLength grows unbounded. Currently this is safe only because setEscapeString() always follows in Wrapper.getReader() and calls calculateMarkLength() which resets the value. However, this inter-call dependency is fragile and undocumented.
- Dominant language
- Java
- Stars
- 9
- Forks
- 36
- Avg merge
- 6h 44m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-filtering
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/maven-filtering#358 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
apache/maven-filtering#357 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/maven-filtering#356 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/maven-filtering#352 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/maven-filtering#350 ·
All issues in apache/maven-filtering
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100