Skip to content

java.lang.NumberFormatException #208

@bpcw

Description

@bpcw

Hi,

starting from semver4j versions beyond 1.0.1, the following program does not work any more and results in a java.lang.NumberFormatException

import org.semver4j.Semver;

public class SemVerTest {

    public static void main(String[] args) {

        Semver versionOld = new Semver("1.24.1-A-20240111143214+a35df53040615b65742729058655a85fa98b84d3");
        Semver versionNew = new Semver("1.24.1-A-20240117112233+bb1b81e5cf1a3ae8ee736590454d023926733417");

        System.out.println(versionOld.compareTo(versionNew));
    }
}

Essentially, the program compares two fictional build versions (1.24.1-A) which only differ by a build timestamp and a commit id.
It seems the compare should not crash when comparing these versions.

BR
bpcw

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions