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

   _Claude Code on behalf of Guillaume Nodet_
   
   **Nit: Strategy fallback not reflected in state**: When graph strategy is 
requested but `BytecodeAnalyzer.isAvailable()` returns false, the code logs a 
warning and falls through to timestamp strategy without updating the 
`incrementalStrategy` field.
   
   If downstream code later checks `incrementalStrategy`, it still sees 
`'graph'` even though timestamp is running, potentially generating misleading 
diagnostics.
   
   **Fix**: Explicitly set the strategy field after fallback:
   ```java
   if (Runtime.version().feature() < 24) {
       logger.warn("Graph incremental strategy requires JDK 24 or later "
               + "(running JDK " + Runtime.version().feature() + "). "
               + "Falling back to timestamp strategy.");
       incrementalStrategy = "timestamp"; // Add this line
   }
   ```
   
   Or store the actual-strategy-in-use in a separate field for clarity.
   


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