Update LoadLibrary.java, pom.xml, and pom.xml

This commit is contained in:
Andrea Cavalli 2020-10-29 17:17:23 +01:00
parent 38ccacd18a
commit 2829f8c089
3 changed files with 5 additions and 4 deletions

View File

@ -25,6 +25,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.concurrent.ConcurrentHashMap;
import java.lang.reflect.InvocationTargetException;
import it.tdlight.jni.ObjectsUtils;
/**
* The class to load the libraries needed to run Tdlib
@ -144,8 +145,8 @@ public class LoadLibrary {
}
InputStream libInputStream;
try {
libInputStream = (InputStream) classForResource.getDeclaredMethod("getLibraryAsStream").invoke(InputStream.class);
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
libInputStream = ObjectsUtils.requireNonNull((InputStream) classForResource.getDeclaredMethod("getLibraryAsStream").invoke(InputStream.class));
} catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | NullPointerException e) {
throw new IOException("Native libraries for platform " + os + "-" + arch + " not found!", e);
}
if (Files.notExists(tempFile)) {

View File

@ -8,7 +8,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0-SNAPSHOT</revision>
<natives-version>3.0.125</natives-version>
<natives-version>3.0.126</natives-version>
</properties>
<repositories>
<repository>

View File

@ -8,7 +8,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0-SNAPSHOT</revision>
<natives-version>3.0.125</natives-version>
<natives-version>3.0.126</natives-version>
</properties>
<repositories>
<repository>