Skip to content

Commit fce1347

Browse files
committed
Removed the way to set a parent, as its actually not needed... We can just fetch it!
1 parent cb791e1 commit fce1347

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/main/java/org/mangorage/bootstrap/Bootstrap.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,13 @@
1515

1616
public final class Bootstrap {
1717

18-
private static ModuleLayer parent;
19-
private static boolean set = false;
20-
21-
public static void setParent(ModuleLayer moduleLayer) {
22-
if (set) return;
23-
set = true;
24-
Bootstrap.parent = moduleLayer;
25-
}
26-
27-
28-
// --launchProfile mangobot
2918
public static void main(String[] args) throws IOException {
19+
ModuleLayer parent = null;
3020

31-
if (parent == null) {
32-
parent = ModuleLayer.boot();
33-
set = true;
21+
if (Bootstrap.class.getModule() != null) {
22+
parent = Bootstrap.class.getModule().getLayer();
23+
} else {
24+
parent = ModuleLayer.boot(); // We dont have a module for Bootstrap..., so assume we are using the boot layer...
3425
}
3526

3627
final var librariesPath = Path.of("libraries");

0 commit comments

Comments
 (0)