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

   In 
`src/main/java/org/apache/maven/shared/filtering/AbstractFilterReaderLineEnding.java`,
 lines 67–73:
   
   ```
   public void setEscapeString(String escapeString) {
       // TODO NPE if escapeString is null ?
       if (escapeString != null && !escapeString.isEmpty()) {
           this.escapeString = escapeString;
           this.useEscape = true;
           calculateMarkLength();
       }
   }
   ```
   
   The code's own TODO acknowledges the problem. When `escapeString` is `null`:
   - `this.escapeString` retains its previous value (not cleared)
   - `this.useEscape` remains `true` if it was previously set from an earlier 
non-null call
   - `calculateMarkLength()` is not called, leaving `markLength` potentially 
wrong
   
   A caller who sets escape string to non-null, then later sets it to null to 
disable escaping, will find escaping still active with the old string. The 
field should be cleared and `useEscape` set to `false` for null/empty input.


-- 
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