gnodet commented on code in PR #2087:
URL: https://github.com/apache/maven-resolver/pull/2087#discussion_r3890840998
##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/PathUtils.java:
##########
@@ -87,9 +87,31 @@ public static void validatePathComponent(String value,
String label) {
if (value != null && !value.isEmpty()) {
// Important: "equals .." and not "contains ..", as if escape
attempted, it will contain path separators
// OTOH: version "1.." is valid version string!
- if (value.equals("..") || value.contains("/") ||
value.contains("\\")) {
+ // Colon is not a valid character in a coordinate component.
+ if (value.equals("..") || value.contains("/") ||
value.contains("\\") || value.contains(":")) {
throw new IllegalArgumentException(
- "Invalid " + label + ": must not contain '..', '/' or
'\\': " + value);
+ "Invalid " + label + ": must not contain '..', '/',
'\\' or ':': " + value);
+ }
+ }
+ }
+
+ /**
+ * Validates a coordinate component that is expanded into multiple path
segments by replacing each dot with a
+ * path separator, like the group ID is. Beside the checks done by
+ * {@link #validatePathComponent(String, String)}, it rejects values
containing empty dot-separated segments
+ * (leading, trailing or consecutive dots), as the expansion of such
values does not compose a valid
+ * relative path.
+ *
+ * @since 2.0.22
Review Comment:
Minor: `@since 2.0.22` is incorrect — tag `maven-resolver-2.0.22` has
already been released without this method. Should be `@since 2.0.23`.
```suggestion
* @since 2.0.23
```
--
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]