Skip to content

Commit

Permalink
Remove unused method
Browse files Browse the repository at this point in the history
# Conflicts:
#	maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelValidator.java
  • Loading branch information
gnodet committed Sep 30, 2024
1 parent 7a50bb3 commit 7ced2ce
Showing 1 changed file with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public void validateFileModel(
validateStringNoExpression("artifactId", problems, Severity.WARNING, Version.V20, m.getArtifactId(), m);
validateStringNotEmpty("artifactId", problems, Severity.FATAL, Version.V20, m.getArtifactId(), m);

validateVersionNoExpression("version", problems, Severity.WARNING, Version.V20, m.getVersion(), m);
validateStringNoExpression("version", problems, Severity.WARNING, Version.V20, m.getVersion(), m);
if (parent == null) {
validateStringNotEmpty("version", problems, Severity.FATAL, Version.V20, m.getVersion(), m);
}
Expand Down Expand Up @@ -1621,37 +1621,6 @@ private boolean validateStringNoExpression(
return false;
}

private boolean validateVersionNoExpression(
String fieldName,
ModelProblemCollector problems,
Severity severity,
Version version,
String string,
InputLocationTracker tracker) {
if (!hasExpression(string)) {
return true;
}

Matcher m = EXPRESSION_NAME_PATTERN.matcher(string.trim());
while (m.find()) {
String property = m.group(1);
if (!versionProcessor.isValidProperty(property)) {
addViolation(
problems,
severity,
version,
fieldName,
null,
"contains an expression but should be a constant.",
tracker);

return false;
}
}

return true;
}

private boolean hasExpression(String value) {
return value != null && value.contains("${");
}
Expand Down

0 comments on commit 7ced2ce

Please sign in to comment.