RFR: 8072379: Implement jdk.Version and jdk.OracleVersion

Iris Clark iris.clark at oracle.com
Tue Feb 2 23:16:27 UTC 2016


Hi.

Thanks again for looking at this change.

> The JEP & implementation allows -$OPT to be specified without +, but the 
> Javadoc one does not allow that. For example, "9-pre-opt" is allowed by 
> JEP, but disallowed by Javadoc.

The JavaDoc and JEP are both slightly wrong in different ways.  The implementation is correct.  Note that it enforces additional constraints beyond just the regular
expression.

I've added a few more regression tests to verify that the behavior is as expected.

This is the updated webrev and javadoc:

    http://cr.openjdk.java.net/~iris/verona/8072379/webrev.4/
    http://cr.openjdk.java.net/~iris/verona/8072379/doc.4/jdk/Version.html (unchanged from doc.3)

> Understood, but I didn't see any part of the JEP or the Javadoc explaining
> that + is needed to make the parser recognize the text followed as options
> instead of pre-release identifier. It would be great if that is added.

I've created a new bug to cover updating both the javadoc and JEP for this case.

    https://bugs.openjdk.java.net/browse/JDK-8148877
    JDK-8148877: (spec) Specify when an empty '+' is required in a version string

This is the key sentence in the description:

  '+' is required for empty build when OPT is present and PRE is not. 
  "9+-opt" and "9-pre-opt" are legal. "9+" is not.

Regards,
iris 


-----Original Message-----
From: Thanh Hong Dai [mailto:hdthanh at tma.com.vn] 
Sent: Monday, February 01, 2016 11:48 PM
To: Iris Clark; Alan Bateman; core-libs-dev at openjdk.java.net
Subject: RE: RFR: 8072379: Implement jdk.Version and jdk.OracleVersion

Dear Iris,

On closer look, there seems to be some conflicting definition of version string.

In JEP: http://openjdk.java.net/jeps/223 $VNUM(-$PRE)?(\+$BUILD)?(-$OPT)?

In Javadoc: http://cr.openjdk.java.net/~iris/verona/8072379/doc.3/jdk/Version.html
$VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)?

In implementation:
The regex follows JEP's definition.

The JEP & implementation allows -$OPT to be specified without +, but the Javadoc one does not allow that. For example, "9-pre-opt" is allowed by JEP, but disallowed by Javadoc.

> I need to capture the plus to distinguish between cases where an empty build is allowed (e.g. "9+-foo") and when it is not ("9+").  
> See code in Version.java, line 226-230 and in Basic.java, line 98, 
> 107-109.  (Note that we use the empty "+"  to distinguish "9-foo" from 
> "9+-foo".)

Understood, but I didn't see any part of the JEP or the Javadoc explaining that + is needed to make the parser recognize the text followed as options instead of pre-release identifier. It would be great if that is added.

Best regards,
Hong Dai Thanh.



More information about the core-libs-dev mailing list