Skip to content

Commit

Permalink
Use FileSystemProvider instead of RandomGenerator. (elastic#110607)
Browse files Browse the repository at this point in the history
FileSystemProvider is no longer provided by SPI as of Java 23 EA build 24.

See openjdk/jdk@42e3c84#diff-03546451d9e4189f639e3af3dcd6a9e44318fff5ceaadce8478cbf0203ac3f45L422-L435
  • Loading branch information
prdoyle authored and rjernst committed Sep 9, 2024
1 parent f44d9e9 commit d33cf61
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,12 @@ public String getTestString() {
package p;
import java.util.ServiceLoader;
import java.util.random.RandomGenerator;
import java.nio.file.spi.FileSystemProvider;
public class ServiceCaller {
public static String demo() {
// check no error if we load a service from the jdk
ServiceLoader<RandomGenerator> randomLoader = ServiceLoader.load(RandomGenerator.class);
ServiceLoader<FileSystemProvider> fileSystemLoader = ServiceLoader.load(FileSystemProvider.class);
ServiceLoader<MyService> loader = ServiceLoader.load(MyService.class, ServiceCaller.class.getClassLoader());
return loader.findFirst().get().getTestString();
Expand Down

0 comments on commit d33cf61

Please sign in to comment.