RFR: 8144062: Move jdk.Version to java.lang.Runtime.Version

forax at univ-mlv.fr forax at univ-mlv.fr
Mon May 16 18:38:03 UTC 2016


----- Mail original -----
> De: "Iris Clark" <iris.clark at oracle.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Java Core Libs" <core-libs-dev at openjdk.java.net>, compiler-dev at openjdk.java.net, verona-dev at openjdk.java.net
> Envoyé: Lundi 16 Mai 2016 19:52:33
> Objet: RE: RFR: 8144062: Move jdk.Version to java.lang.Runtime.Version
> 
> Hi, Remi.

Hi Iris,

> 
> Thanks for taking the time to review this change.
> 
> > java.lang.Runtime.Version is used during the boot process
> 
> I don’t think that Runtime.Version is used during boot because
> I'm not seeing it loaded with a small test program invoked with
> "java -verbose:class Hi".  In fact, I'm not seeing a difference
> in the number of loaded classes between promoted build 118 and
> my build for 8144062 (based on jdk9/dev).  See appended stats.
> 
> If my test program is in a JAR file, then more classes are
> loaded including Runtime.Version; however the equivalent number
> of classes are loaded before my changes too.

I've double checked and yes, Runtime.Version is not loaded by default,
my bad on this, it's own runtime that has an indirect dependency on Runtime.Version.

> 
> The performance problem identified by the following bug should
> resolve this issue:
> 
>   8150678: JarFile stream() and entries(0 methods need performance
>     enhancement
>   https://bugs.openjdk.java.net/browse/JDK-8150678
> 
> Regards,
> Iris

regards,
Rémi

> 
> -----
> $ cat Hi.java
> public class Hi {
>     public static void main(String ... args) {
>         System.out.println("hi");
>         System.exit(42);
>     }
> $ wc Hi.ver*
>    501   2000  39758 Hi.verbose-118
>    576   2300  45915 Hi.verbose-118-jar
>    501   2000  39734 Hi.verbose-8144062
>    576   2300  45905 Hi.verbose-8144062-jar
>   2154   8600 171312 total
> 
> -----Original Message-----
> From: Remi Forax [mailto:forax at univ-mlv.fr]
> Sent: Friday, May 13, 2016 4:32 PM
> To: Iris Clark
> Cc: Java Core Libs; compiler-dev at openjdk.java.net;
> verona-dev at openjdk.java.net
> Subject: Re: RFR: 8144062: Move jdk.Version to java.lang.Runtime.Version
> 
> Hi Iris,
> is there a way to avoid to use regex when parsing the version ?
> 
> java.lang.Runtime.Version is used during the boot process, so now every Java
> programs loads a bunch of classes related to java.util.regex even if they do
> not use any regex or use another regex engine (like Nashorn or JRuby).
> 
> regards,
> Rémi
> 
> ----- Mail original -----
> > De: "Iris Clark" <iris.clark at oracle.com>
> > À: "Java Core Libs" <core-libs-dev at openjdk.java.net>,
> > compiler-dev at openjdk.java.net
> > Cc: verona-dev at openjdk.java.net
> > Envoyé: Samedi 14 Mai 2016 01:20:23
> > Objet: RFR: 8144062: Move jdk.Version to java.lang.Runtime.Version
> > 
> > Hi.
> > 
> > Reviving this work from a few months back.
> > 
> > Please review the following changes to move jdk.Version to
> > java.lang.Runtime.Version.
> > 
> > Bug
> > 
> >     8144062: Move jdk.Version to java.lang.Runtime.Version
> >     https://bugs.openjdk.java.net/browse/JDK-8144062
> > 
> > webrev
> > 
> >     http://cr.openjdk.java.net/~iris/verona/8144062/webrev.1/
> > 
> > When jdk.Version was initially pushed in jdk-9+1-5, it was Improperly
> > exported by java.base.  After exploring a few options, the best choice
> > was to move jdk.Version to java.lang.Runtime.Version (a nested class
> > of Runtime).  By making Version an SE API, it may be exported by the
> > java.base module.
> > 
> > As part of the move, a limited number of chnages were made to the
> > Version class:
> > 
> >   - Change package name and class declaration (to static)
> >   - Eliminate use of "JDK" when describing a Java SE API
> >   - Initial clarifications related to zeros (trailing vs.
> >     Internal components)
> >   - Small typographical and grammatical enhancements
> >   - Indentation
> > 
> > The complete Runtime.Version specification is available here:
> > 
> >   
> > http://cr.openjdk.java.net/~iris/verona/8144062/doc.1/java/lang/Runtim
> > e.Version.html
> > 
> > The old jdk.Version.current() was replaced with Runtime.version().
> > 
> > In System.getProperties(), we indicate which version-related system
> > properties may be supported by Runtime.Version.
> > 
> > The remaining jdk and langtools file changes are all side-effects of
> > changing jdk.Version.current() to Runtime.version().
> > 
> > Thanks,
> > Iris
> > 
> 


More information about the compiler-dev mailing list