This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/master by this push:
new 275bf82701 Remove extra variable (#2398)
275bf82701 is described below
commit 275bf8270178f2ea4976a3ad78afd603970aa76f
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Fri Jun 6 15:15:11 2025 +0000
Remove extra variable (#2398)
* Reapply "remove extra variable"
---
.../org/apache/maven/impl/model/DefaultInterpolator.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git
a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultInterpolator.java
b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultInterpolator.java
index 0d969222d4..422a800f52 100644
---
a/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultInterpolator.java
+++
b/impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultInterpolator.java
@@ -263,10 +263,9 @@ private static String doSubstVars(
// Using the start and stop delimiter indices, extract
// the first, deepest nested variable placeholder.
String variable = val.substring(startDelim + DELIM_START.length(),
stopDelim);
- String org = variable;
- String substValue = processSubstitution(
- variable, org, cycleMap, configProps, callback, postprocessor,
defaultsToEmptyString);
+ String substValue =
+ processSubstitution(variable, cycleMap, configProps, callback,
postprocessor, defaultsToEmptyString);
// Append the leading characters, the substituted value of
// the variable, and the trailing characters to get the new
@@ -285,7 +284,6 @@ private static String doSubstVars(
private static String processSubstitution(
String variable,
- String org,
Set<String> cycleMap,
Map<String, String> configProps,
UnaryOperator<String> callback,
@@ -327,8 +325,8 @@ private static String processSubstitution(
String opValue = variable.substring(idx + 2, nextIdx >= 0 ?
nextIdx : variable.length());
// Process the operator value through substitution if it contains
variables
- String processedOpValue =
- doSubstVars(opValue, org, cycleMap, configProps, callback,
postprocessor, defaultsToEmptyString);
+ String processedOpValue = doSubstVars(
+ opValue, variable, cycleMap, configProps, callback,
postprocessor, defaultsToEmptyString);
// Apply the operator
if (":+".equals(op)) {
@@ -344,7 +342,7 @@ private static String processSubstitution(
break;
}
} else {
- throw new InterpolatorException("Bad substitution operator in:
${" + org + "}");
+ throw new InterpolatorException("Bad substitution operator in:
${" + variable + "}");
}
startIdx = nextIdx >= 0 ? nextIdx : variable.length();