elharo opened a new issue, #168:
URL: https://github.com/apache/maven-toolchains-plugin/issues/168

   ## Summary
   
   The  method in  has an unchecked null chain that can throw a . The 
equivalent method in  correctly guards against nulls.
   
   ## Location
   
   
   
   
https://github.com/apache/maven-toolchains-plugin/blob/master/src/main/java/org/apache/maven/plugins/toolchain/jdk/SelectJdkToolchainMojo.java#L218-L221
   
   ## Code
   
   
   
   ## Problem
   
   Each call in the chain can return null without a guard:
   1.  could return null
   2.  could return null (causing NPE on the cast)
   3.  cast itself could throw ClassCastException if configuration is not 
Xpp3Dom
   4.  could return null
   5.  on null would throw NPE
   
   Compare with the properly guarded version in :
   
   
   
   ## Impact
   
   Can cause NPE during  execution in  mode, specifically on this line:
   
   
   ## Suggested Fix
   
   Add null guards matching the pattern used in , or better yet, reuse that 
method by extracting it to a shared utility.


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