gnodet commented on PR #1165:
URL: 
https://github.com/apache/maven-compiler-plugin/pull/1165#issuecomment-7394864077

   _Claude Code on behalf of Guillaume Nodet_
   
   **JAR fingerprint caching issue**: `resolveFromJar()` reuses cached 
fingerprints for unchanged JARs without validating that the requested type was 
actually resolved from that specific JAR in the previous build.
   
   **Scenario**:
   - Build 1: `Foo.class` in `lib-1.0.jar` (fp=ABC), cached as `'Foo→ABC'`
   - Build 2: `lib-1.0.jar` unchanged, `lib-2.0.jar` added with `Foo.class` 
(fp=DEF)
   - Classpath: `[lib-2.0.jar, lib-1.0.jar]`
   - `resolveFromJar(lib-1.0.jar)` finds Foo in `unchangedJars`, returns cached 
ABC
   - Actual `Foo` from `lib-2.0.jar` (fp=DEF) not detected
   - Consumers not recompiled despite ABI change
   
   **Fix**: Store JAR path alongside each cached fingerprint:
   ```java
   // Cache format: "type@jarPath" → fingerprint
   String cacheKey = type + "@" + jarPath.toString();
   String cached = unchangedJars.get(cacheKey);
   if (cached != null) {
       return cached;
   }
   // ... resolve and store with cacheKey
   ```
   


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