> Please review this small fix.
> 
> **Problem:**
> 
> After parsing the version number, the parser enters the pre-release parsing 
> loop regardless of whether the delimiter was `-` or `+`. As a result, 
> build-only versions such as `1+1` are parsed as pre-release versions, causing 
> `1+1` to compare equal to `1-1`.
> 
> **Fix:**
> 
> Record whether the version number ended with `-`, and only parse the 
> pre-release component in that case. If it ended with `+`, proceed directly to 
> the build component.
> 
> **Testing:**
> 
> - Added regression cases to `VersionTest.java`.
> - `make test TEST=test/jdk/java/lang/module`: 17 passed, 0 failed.
> 
> 
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Yunbo Zhang has updated the pull request incrementally with one additional 
commit since the last revision:

  8250677: Simplify pre-release parsing

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/32715/files
  - new: https://git.openjdk.org/jdk/pull/32715/files/d249d987..4861b444

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=32715&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32715&range=00-01

  Stats: 21 lines in 2 files changed: 7 ins; 4 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/32715.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32715/head:pull/32715

PR: https://git.openjdk.org/jdk/pull/32715

Reply via email to