This is an automated email from the ASF dual-hosted git repository.

He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git


The following commit(s) were added to refs/heads/main by this push:
     new 640e790be5 Fix comparing release against pre-release versions (#3154)
640e790be5 is described below

commit 640e790be58afddc62cf6aaa390e5728116796cd
Author: Philippus Baalman <[email protected]>
AuthorDate: Tue Jun 23 16:48:52 2026 +0200

    Fix comparing release against pre-release versions (#3154)
---
 actor-tests/src/test/scala/org/apache/pekko/util/VersionSpec.scala | 1 +
 actor/src/main/scala/org/apache/pekko/util/Version.scala           | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/actor-tests/src/test/scala/org/apache/pekko/util/VersionSpec.scala 
b/actor-tests/src/test/scala/org/apache/pekko/util/VersionSpec.scala
index 1682cdde26..148e688034 100644
--- a/actor-tests/src/test/scala/org/apache/pekko/util/VersionSpec.scala
+++ b/actor-tests/src/test/scala/org/apache/pekko/util/VersionSpec.scala
@@ -60,6 +60,7 @@ class VersionSpec extends AnyWordSpec with Matchers {
       Version("1.2.3-M1") should !==(Version("1.2.3-M2"))
       Version("1.2-M1") should be < Version("1.2.0")
       Version("1.2.0-M1") should be < Version("1.2.0")
+      Version("1.2.0") should be > Version("1.2.0-M1")
       Version("1.2.3-M2") should be > Version("1.2.3-M1")
     }
 
diff --git a/actor/src/main/scala/org/apache/pekko/util/Version.scala 
b/actor/src/main/scala/org/apache/pekko/util/Version.scala
index 1e44e4e67b..8555c95d88 100644
--- a/actor/src/main/scala/org/apache/pekko/util/Version.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/Version.scala
@@ -169,7 +169,7 @@ final class Version(val version: String) extends 
Comparable[Version] {
             if (diff == 0) {
               if (rest == "" && other.rest != "")
                 diff = 1
-              if (other.rest == "" && rest != "")
+              else if (other.rest == "" && rest != "")
                 diff = -1
               else
                 diff = rest.compareTo(other.rest)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to