gnodet commented on PR #1165:
URL:
https://github.com/apache/maven-compiler-plugin/pull/1165#issuecomment-7394848289
_Claude Code on behalf of Guillaume Nodet_
**Config hash collision**: The option hashing uses `String.join("|",
configuration.options)`, which can produce collisions when option values
contain the pipe character.
**Scenario**:
- Build 1: options `['-Xlint:all', '-Afoo=bar|baz']` → hash =
`'opts:-Xlint:all|-Afoo=bar|baz;'`
- Build 2: options `['-Xlint:all|-Afoo=bar', 'baz']` → hash =
`'opts:-Xlint:all|-Afoo=bar|baz;'` (same!)
- Result: Config hash matches even though options changed → no rebuild
triggered
**Fix**: Use length-prefixed encoding or escape the delimiter:
```java
var optHash = configuration.options.stream()
.map(opt -> opt.length() + ":" + opt)
.collect(Collectors.joining(","));
hashBuf.append("opts:").append(optHash).append(";");
```
--
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]