Example code in JDK8 requiring change for modular function

Paul Sandoz paul.sandoz at oracle.com
Wed May 9 03:51:36 PDT 2012


On May 7, 2012, at 6:34 PM, Mandy Chung wrote:

> On 5/7/2012 1:52 AM, Paul Sandoz wrote:
>> So this is good example of where we could have two code paths based on a boolean check if running in module mode or not.
> 
> 
> It's good that you start looking into this example and others in JDK that
> will need to handle across the board.  FYI. I added a few static methods
> in org.openjdk.jigsaw.Platform, part of the changes I posted [1]:
>  http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/module-class-loading/webrev-jigsaw-ms/src/share/classes/org/openjdk/jigsaw/Platform.java.sdiff.html
> 

Thanks.

To do general changes in JDK8 we will have to provide some of those static methods, say in a class in sun.misc as a temporary solution until Jigsaw is merged back. e.g.

package sun.misc;

// This class will be removed after the Jigsaw code base is pushed to JDK8 and classes that depend on this class
// and its methods will be updated to utilize the equivalent Jigsaw functionality
public class Platform {
  public static boolean isModuleMode() { return false; }
}

Paul.

> Mandy
> 
> [1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2012-May/002498.html
> 




More information about the jigsaw-dev mailing list