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:
One could argue that "understanding" is a complex goal for this codebase.
The presence of incorrect, ignored, and unused segments suggests that the
original intent has become obscured over time. It's likely the logic was once
valid, but that context has been lost.
The system continues to operate, but its current behavior appears
disconnected from its actual purpose, seemingly functioning through emergent
coincidence rather than by explicit design (no unused stuff dangling around).
In these situations, static code analysis becomes a valuable tool for
reconstructing the rationale behind the code. As team members move on,
institutional knowledge fades, and manual auditing does not scale effectively.
From my perspective, comprehending the full scope is challenging. For
instance, the purpose of an unused field isn't clear, requiring me to
hypothesize about its original function.
Ideally, code should narrate its purpose like a coherent story, with each
line building upon the last. Gaps in this narrative—such as unused components
or logical inconsistencies—highlight areas where the underlying purpose has
been lost. While there may be valid, albeit hidden, reasons for these
anomalies, the process of understanding involves methodically converting these
open questions into resolved answers to piece together the complete picture.
--
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]