1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Description: Fixes the compatibility issues with Java 9
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/src/de/intarsys/nativec/api/NativeInterface.java
+++ b/src/de/intarsys/nativec/api/NativeInterface.java
@@ -31,7 +31,7 @@
import java.util.Iterator;
-import sun.misc.Service;
+import java.util.ServiceLoader;
/**
* Access the VM singleton for {@link INativeInterface}.
@@ -81,7 +81,7 @@
if (loader == null) {
loader = NativeInterface.class.getClassLoader();
}
- Iterator ps = Service.providers(INativeInterface.class, loader);
+ Iterator ps = ServiceLoader.load(INativeInterface.class, loader).iterator();
if (ps.hasNext()) {
try {
return (INativeInterface) ps.next();
|