55 // Define module: m1 |
55 // Define module: m1 |
56 // Can read: java.base, m2 |
56 // Can read: java.base, m2 |
57 // Packages: p1 |
57 // Packages: p1 |
58 // Packages exported: p1 is exported to unqualifiedly |
58 // Packages exported: p1 is exported to unqualifiedly |
59 ModuleDescriptor descriptor_m1 = |
59 ModuleDescriptor descriptor_m1 = |
60 new ModuleDescriptor.Builder("m1") |
60 ModuleDescriptor.module("m1") |
61 .requires("java.base") |
61 .requires("java.base") |
62 .requires("m2") |
62 .requires("m2") |
63 .exports("p1") |
63 .exports("p1") |
64 .build(); |
64 .build(); |
65 |
65 |
69 // Packages exported: package p2 is exported to m1 and m3 |
69 // Packages exported: package p2 is exported to m1 and m3 |
70 Set<String> targets = new HashSet<>(); |
70 Set<String> targets = new HashSet<>(); |
71 targets.add("m1"); |
71 targets.add("m1"); |
72 targets.add("m3"); |
72 targets.add("m3"); |
73 ModuleDescriptor descriptor_m2 = |
73 ModuleDescriptor descriptor_m2 = |
74 new ModuleDescriptor.Builder("m2") |
74 ModuleDescriptor.module("m2") |
75 .requires("java.base") |
75 .requires("java.base") |
76 .requires("m3") |
76 .requires("m3") |
77 .exports("p2", targets) |
77 .exports("p2", targets) |
78 .build(); |
78 .build(); |
79 |
79 |
80 // Define module: m3 |
80 // Define module: m3 |
81 // Can read: java.base |
81 // Can read: java.base |
82 // Packages: p3 |
82 // Packages: p3 |
83 // Packages exported: none |
83 // Packages exported: none |
84 ModuleDescriptor descriptor_m3 = |
84 ModuleDescriptor descriptor_m3 = |
85 new ModuleDescriptor.Builder("m3") |
85 ModuleDescriptor.module("m3") |
86 .requires("java.base") |
86 .requires("java.base") |
87 .build(); |
87 .build(); |
88 |
88 |
89 // Set up a ModuleFinder containing all modules for this layer. |
89 // Set up a ModuleFinder containing all modules for this layer. |
90 ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); |
90 ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); |