Pankraz76 commented on code in PR #11284:
URL: https://github.com/apache/maven/pull/11284#discussion_r2438783475


##########
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultSettingsBuilder.java:
##########
@@ -228,17 +228,16 @@ private Settings readSettings(
         return settings;
     }
 
-    private Settings interpolate(
-            Settings settings, SettingsBuilderRequest request, 
ProblemCollector<BuilderProblem> problems) {
-        UnaryOperator<String> src;
-        if (request.getInterpolationSource().isPresent()) {
-            src = request.getInterpolationSource().get();
-        } else {
-            Map<String, String> userProperties = 
request.getSession().getUserProperties();
-            Map<String, String> systemProperties = 
request.getSession().getSystemProperties();
-            src = Interpolator.chain(userProperties::get, 
systemProperties::get);
-        }
-        return new DefSettingsTransformer(value -> value != null ? 
interpolator.interpolate(value, src) : null)
+    private Settings interpolate(Settings settings, SettingsBuilderRequest 
request) {

Review Comment:
   Yes, but 'understanding' is a strong word. The code is a testament to the 
absence of understanding, which is obvious from the incorrect, ignored, and 
unused parts. It might have made sense once, but that meaning is gone.
   
   The code, however, remains—disconnected from its original purpose. It's just 
working by accident.
   
   Static code analysis is the only way to rebuild that connection, because 
humans leave out and don't scale.



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