Sovetouch opened a new pull request, #1031:
URL: https://github.com/apache/tomcat/pull/1031

   **Motivation:**
   While reviewing static analysis findings, a potential NullPointerException 
was reported for a call to Properties.getProperty(). In the current 
implementation, the code iterates over props.keySet(), so every key is 
guaranteed to exist and getProperty() will not return null in practice. 
However, this safety relies on an implicit assumption about how the loop works 
today. If the code is refactored in the future to use keys from another source, 
the warning could become a real issue.
   
   **Changes:**
   Added an explicit value == null check before accessing the string value. 
This makes the code more defensive and aligns it with the 
Properties.getProperty() contract, which allows returning null.
   Replaced trim().length() == 0 with the more idiomatic and readable 
trim().isEmpty().
   
   **Impact:**
   Low risk. This affects a build utility 
(org.apache.tomcat.buildutil.translate.Import) rather than the Tomcat runtime 
itself. It improves readability and makes the code more resilient to future 
changes without affecting the current behavior.
   
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to