You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "cstamas (via GitHub)" <gi...@apache.org> on 2023/02/14 09:59:13 UTC

[GitHub] [maven-resolver] cstamas opened a new pull request, #242: Small helper similar to maven-artifact ComparableVersion

cstamas opened a new pull request, #242:
URL: https://github.com/apache/maven-resolver/pull/242

   Just a small helper to simplify version parsing peculiarities and compare them to ComparableVersion in cases like MNG-7690 is. The code and output is intentionally copy-paste for simpler output comparison.
   
   No issue created, as this is really not a feature or new API in resolver.


-- 
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


[GitHub] [maven-resolver] gnodet commented on pull request #242: Small helper similar to maven-artifact ComparableVersion

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #242:
URL: https://github.com/apache/maven-resolver/pull/242#issuecomment-1429460478

   Have you tried using [jbang](https://www.jbang.dev) instead ? This makes things much more usable imho.


-- 
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


[GitHub] [maven-resolver] laeubi commented on a diff in pull request #242: Small helper similar to maven-artifact ComparableVersion

Posted by "laeubi (via GitHub)" <gi...@apache.org>.
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


[GitHub] [maven-resolver] gnodet commented on a diff in pull request #242: Small helper similar to maven-artifact ComparableVersion

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #242:
URL: https://github.com/apache/maven-resolver/pull/242#discussion_r1105582642


##########
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:
   If it's only wrapped in a list, maybe wrap it in the method ?
   ```
   List<Item> asItems() {
       return Arrays.asList( items );
   }
   ```



-- 
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


[GitHub] [maven-resolver] gnodet commented on a diff in pull request #242: Small helper similar to maven-artifact ComparableVersion

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on code in PR #242:
URL: https://github.com/apache/maven-resolver/pull/242#discussion_r1105581036


##########
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:
   It's not a public method though...



-- 
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


[GitHub] [maven-resolver] michael-o commented on a diff in pull request #242: Small helper similar to maven-artifact ComparableVersion

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on code in PR #242:
URL: https://github.com/apache/maven-resolver/pull/242#discussion_r1105570938


##########
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:
   Are those immutable?



-- 
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


[GitHub] [maven-resolver] cstamas merged pull request #242: Small helper similar to maven-artifact ComparableVersion

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas merged PR #242:
URL: https://github.com/apache/maven-resolver/pull/242


-- 
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


[GitHub] [maven-resolver] cstamas commented on a diff in pull request #242: Small helper similar to maven-artifact ComparableVersion

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #242:
URL: https://github.com/apache/maven-resolver/pull/242#discussion_r1105580786


##########
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:
   Is this question rhetorical?



-- 
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