You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/07/01 15:35:39 UTC

[I] setDelimiterSpecs() accumulates markLength instead of recalculating [maven-filtering]

elharo opened a new issue, #354:
URL: https://github.com/apache/maven-filtering/issues/354

   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.


-- 
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: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] setDelimiterSpecs() accumulates markLength instead of recalculating [maven-filtering]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed issue #354: setDelimiterSpecs() accumulates markLength instead of recalculating
URL: https://github.com/apache/maven-filtering/issues/354


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org