Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

mandy chung mandy.chung at oracle.com
Thu Dec 7 16:57:51 UTC 2017


Hi Adam,

java.management should not require java.logging. PlatformLoggingMXBean 
is registered to the platform MBeanServer only if java.logging is 
present in the runtime.  This is detected dynamically [1].  I would 
recommend to replace the static dependencies to java.util.logging using 
similar approach as
DefaultPlatformMBeanProvider.

Hope this helps.
Mandy
[1] 
http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java#l358

On 12/7/17 8:35 AM, Adam Farley8 wrote:
> P.S. I did some digging, and it seems that though OpenJ9 has several 
> .extra files, only one appears to have a "requires" entry. It's the 
> one I mentioned below.
>
> A search for "java.util.logging" (the "requires" module's package) 
> reveals three classes inside that directory that use it:
>
> - com/ibm/java/lang/management/internal/ManagementUtils.java
> - com/ibm/java/lang/management/internal/LoggingMXBeanImpl.java
> - java/lang/management/PlatformLoggingMXBean.java
>
> Ideally it'd be good to keep this functionality in these classes.
>
> Best Regards
>
> Adam Farley
>
>
>
> From: Adam Farley8/UK/IBM
> To: mandy chung <mandy.chung at oracle.com>
> Cc: jigsaw-dev at openjdk.java.net
> Date: 07/12/2017 16:25
> Subject: Re: Proposal for New Functionality: Allow module-info merging 
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
> Hi Mandy,
>
> Sure. Here's an example of a module-info file, and the .extra file 
> that gets merged with it:
>
> https://github.com/ibmruntimes/openj9-openjdk-jdk9/blob/openj9/jdk/src/java.management/share/classes/module-info.java 
>
> https://github.com/eclipse/openj9/blob/master/jcl/src/java.management/share/classes/module-info.java.extra 
>
>
> Note that the former is simple a clone of most of JDK9 (sans hotspot), 
> with the addition of a handful of changes to make it fit with OpenJ9. 
> That module-info.java file was not changed.
>
> If you'd like to see the build in action (complete with module-info 
> merging), go here:
>
> https://www.eclipse.org/openj9/oj9_build.html
>
> That contains instructions to build with OpenJ9 for JDK8 and JDK9 (the 
> toggle is on the top-left of the screen).
>
> Prebuilt binaries can be found at the AdoptOpenJDK website.
>
> Best Regards
>
> Adam Farley
>
>
>
>
> From: mandy chung <mandy.chung at oracle.com>
> To: Adam Farley8 <adam.farley at uk.ibm.com>
> Cc: jigsaw-dev at openjdk.java.net
> Date: 07/12/2017 16:12
> Subject: Re: Proposal for New Functionality: Allow module-info merging 
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
>
> Can you send some example module-info.java & .extra files and source 
> location that shows what functionality you depend on?
>
> Mandy
>
> On 12/7/17 4:20 AM, Adam Farley8 wrote:
> Update: OpenJ9 appears to need this functionality.
>
> Best Regards
>
> Adam Farley
>
>
>
> From: Adam Farley8/UK/IBM
> To: mandy chung _<mandy.chung at oracle.com>_ <mailto:mandy.chung at oracle.com>
> Cc: _jigsaw-dev at openjdk.java.net_ <mailto:jigsaw-dev at openjdk.java.net>
> Date: 07/12/2017 12:14
> Subject: Re: Proposal for New Functionality: Allow module-info merging 
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
> Hi Mandy,
>
> I don't believe anyone should need the "requires" to be different on 
> different platforms, however the logic in there can be used for 
> merging additional requires supplied by new components (like OpenJ9).
>
> I'm exploring whether or not OpenJ9 can live without the extra 
> "requires" right now.
>
> If it does, or if this feature is needed by someone else, I can't 
> think of a better place to keep this logic. Any thoughts?
>
> Best Regards
>
> Adam Farley
>
>
>
>
> From: mandy chung _<mandy.chung at oracle.com>_ 
> <mailto:mandy.chung at oracle.com>
> To: Adam Farley8 _<adam.farley at uk.ibm.com>_ 
> <mailto:adam.farley at uk.ibm.com>
> Cc: _jigsaw-dev at openjdk.java.net_ <mailto:jigsaw-dev at openjdk.java.net>
> Date: 06/12/2017 18:51
> Subject: Re: Proposal for New Functionality: Allow module-info merging 
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
>
> Moving this to jigsaw-dev....
>
> On 12/6/17 8:38 AM, Adam Farley8 wrote:
> Hi All,
>
> Currently, GenModuleInfoSource.java does not allow you to merge extra
> module-info files into the primary module-info file (for a given module)
> at build time.
>
>
> This tool intends to augment platform-specific 
> exports/opens/uses/provides but not requires.  It was a design choice 
> we made that JDK modules are expected to have the same dependences for 
> all platforms.
>
> Put simply; I think it should have this functionality. Can committers
> please review and opine?
>
> Can you explain why you want the module dependences be different on 
> different platform?  Is it an option to add the requires 
> src/<module>/share/classes/module-info.java ?
>
> The build generates the target dependences based on the requires from 
> module-info.java. At the moment it does not take 
> module-info.java.extra into account AFAIU.
>
> Mandy
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with 
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with 
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 
> 3AU
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with 
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with 
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU



More information about the jigsaw-dev mailing list