hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java
changeset 44520 0553e129e0ec
parent 40891 8010999ff6d0
equal deleted inserted replaced
44471:7e8e5ceecf99 44520:0553e129e0ec
     1 /*
     1 /*
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 import java.lang.reflect.Module;
       
    25 import java.lang.reflect.Layer;
       
    26 import java.util.Set;
    24 import java.util.Set;
    27 import java.util.HashSet;
    25 import java.util.HashSet;
    28 
    26 
    29 /**
    27 /**
    30  * The debuggee to be launched by the test
    28  * The debuggee to be launched by the test
    33  */
    31  */
    34 public class AllModulesCommandTestDebuggee {
    32 public class AllModulesCommandTestDebuggee {
    35 
    33 
    36     public static void main(String[] args) throws InterruptedException {
    34     public static void main(String[] args) throws InterruptedException {
    37 
    35 
    38         int modCount = Layer.boot().modules().size();
    36         int modCount = ModuleLayer.boot().modules().size();
    39 
    37 
    40         // Send all modules names via the process output
    38         // Send all modules names via the process output
    41         for (Module mod : Layer.boot().modules()) {
    39         for (Module mod : ModuleLayer.boot().modules()) {
    42             String info = String.format("module %s", mod.getName());
    40             String info = String.format("module %s", mod.getName());
    43             write(info);
    41             write(info);
    44         }
    42         }
    45         // Signal that the sending is done
    43         // Signal that the sending is done
    46         write("ready");
    44         write("ready");