Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160954

(spec) Runtime.Version regex and $PRE/$OPT issues

XMLWordPrintable

    • b167
    • Not verified

        1) Runtime.Version spec says regarding $VNUM format:
        "The format is: ^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$"
        There is "$" in the end of $VNUM. "$" is end of line template.
        However, the following code will throw IllegalArgumentException:

        Version.parse("1.1.1" + System.lineSeparator());

        Seems this is the spec problem and the template should be updated to the same but without "$" in the end.

        2) According to the current spec the template for the version string is
        $VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)?
        There is no words regarding the case when $PRE and $OPT is used without $BUILD or when "+" is used without $BUILD and $OPT.
        However, the following code will throw IllegalArgumentException:

        - Version.parse("1.1.1-ea+--abc");
        - Version.parse("1.1.1-ea+");

        Seems this is the spec problem and the spec need to be supplemented with exception cases.

              prappo Pavel Rappo (Inactive)
              evotchen Elena Votchennikova (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: