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

Iris Clark iris.clark at oracle.com
Wed Feb 3 03:14:09 UTC 2016


Hi.

> Also, please update the JavaDoc at line 48, 113, optionally line 130 
> of Version.java, plus the comment at line 160 of Version.java to 
> match the JEP, since you confirm "9-pre-opt" is valid.

I've added the specific Version.java line numbers to 8148877.

My sponsor will push the changes for 8072379 soon.

Regards,
Iris

-----Original Message-----
From: Thanh Hong Dai [mailto:hdthanh at tma.com.vn] 
Sent: Tuesday, February 02, 2016 7:08 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,

> 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.

It would be great if those additional constraints are also documented outside the code (JavaDoc or JEP).

Also, please update the JavaDoc at line 48, 113, optionally line 130 of Version.java, plus the comment at line 160 of Version.java to match the JEP, since you confirm "9-pre-opt" is valid.

Best regards,
Hong Dai Thanh.


-----Original Message-----
From: Iris Clark [mailto:iris.clark at oracle.com]
Sent: Wednesday, 3 February, 2016 6:16 AM
To: Thanh Hong Dai <hdthanh at tma.com.vn>; Alan Bateman <alan.bateman at oracle.com>; core-libs-dev at openjdk.java.net
Subject: RE: RFR: 8072379: Implement jdk.Version and jdk.OracleVersion

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