mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8374923: runtime/cds/ServiceLoaderTest.java fails with mismatch between cds and non-cds
Reviewed-by: almatvee
This commit is contained in:
parent
12894a870a
commit
659b53fe33
@ -64,7 +64,7 @@ public final class Main {
|
||||
}
|
||||
|
||||
public Provider() {
|
||||
this(Main::loadBundlingEnvironment);
|
||||
this(DefaultBundlingEnvironmentLoader.INSTANCE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -104,7 +104,7 @@ public final class Main {
|
||||
}
|
||||
|
||||
static int run(PrintWriter out, PrintWriter err, String... args) {
|
||||
return run(Main::loadBundlingEnvironment, out, err, args);
|
||||
return run(DefaultBundlingEnvironmentLoader.INSTANCE, out, err, args);
|
||||
}
|
||||
|
||||
static int run(Supplier<CliBundlingEnvironment> bundlingEnvSupplier, PrintWriter out, PrintWriter err, String... args) {
|
||||
@ -310,9 +310,14 @@ public final class Main {
|
||||
return System.getProperty("java.version");
|
||||
}
|
||||
|
||||
private static CliBundlingEnvironment loadBundlingEnvironment() {
|
||||
return ServiceLoader.load(
|
||||
CliBundlingEnvironment.class,
|
||||
CliBundlingEnvironment.class.getClassLoader()).findFirst().orElseThrow();
|
||||
private enum DefaultBundlingEnvironmentLoader implements Supplier<CliBundlingEnvironment> {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
public CliBundlingEnvironment get() {
|
||||
return ServiceLoader.load(
|
||||
CliBundlingEnvironment.class,
|
||||
CliBundlingEnvironment.class.getClassLoader()).findFirst().orElseThrow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user