gnodet opened a new pull request, #12336:
URL: https://github.com/apache/maven/pull/12336

   ## Summary
   
   - `PlexusContainer.lookup()` can return `null` instead of throwing 
`ComponentLookupException`. `DefaultLookup.lookupOptional()` wraps the result 
with `Optional.of()`, which throws `NullPointerException` on null input. 
Changed to `Optional.ofNullable()` so a null result is correctly represented as 
`Optional.empty()`.
   - This fixes `maven-jdeprscan-plugin` integration tests (`list-default`, 
`list-forremoval`) which fail on Maven 4.0.x because 
`DefaultToolchainManager.retrieveContext()` calls 
`lookupOptional(Project.class)` and the container returns null.
   
   ## Test plan
   
   - [x] Built `maven-jdeprscan-plugin` with this fix and verified all 6 
integration tests pass (previously 2 failed with NPE)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   _Claude Code on behalf of Guillaume Nodet_


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