You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "laeubi (via GitHub)" <gi...@apache.org> on 2023/02/14 10:21:53 UTC
[GitHub] [maven-resolver] laeubi commented on a diff in pull request #242: Small helper similar to maven-artifact ComparableVersion
laeubi commented on code in PR #242:
URL: https://github.com/apache/maven-resolver/pull/242#discussion_r1105586669
##########
maven-resolver-util/src/main/java/org/eclipse/aether/util/version/GenericVersion.java:
##########
@@ -55,6 +55,26 @@
hash = Arrays.hashCode( items );
}
+ /**
+ * Returns this instance backing string representation.
+ *
+ * @since 1.9.5
+ */
+ String asString()
+ {
+ return version;
+ }
+
+ /**
+ * Returns this instance tokenized representation.
+ *
+ * @since 1.9.5
+ */
+ Item[] asItems()
+ {
+ return items;
Review Comment:
This will still allow to modify the array, just wanted to note that ... As mentioned elsewhere, using streams is much safer, e.g. Arrays.stream(items), then one can collect it to list, array, whatever without the risk of modify the underlying array.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org