Skip to content

Commit 25a3407

Browse files
authored
NativeLibraryLoader: more detailed exception in computeNativesHash() (#2001)
1 parent d418e1f commit 25a3407

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jme3-desktop/src/main/java/com/jme3/system/NativeLibraryLoader.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ private static void setExtractionFolderToUserCache() {
273273

274274
private static int computeNativesHash() {
275275
URLConnection conn = null;
276-
try {
277-
String classpath = System.getProperty("java.class.path");
278-
URL url = Thread.currentThread().getContextClassLoader().getResource("com/jme3/system/NativeLibraryLoader.class");
276+
String classpath = System.getProperty("java.class.path");
277+
URL url = Thread.currentThread().getContextClassLoader().getResource("com/jme3/system/NativeLibraryLoader.class");
279278

279+
try {
280280
StringBuilder sb = new StringBuilder(url.toString());
281281
if (sb.indexOf("jar:") == 0) {
282282
sb.delete(0, 4);
@@ -293,7 +293,8 @@ private static int computeNativesHash() {
293293
int hash = classpath.hashCode() ^ (int) conn.getLastModified();
294294
return hash;
295295
} catch (IOException ex) {
296-
throw new UnsupportedOperationException(ex);
296+
throw new UncheckedIOException("Failed to open file: '" + url
297+
+ "'. Error: " + ex, ex);
297298
} finally {
298299
if (conn != null) {
299300
try {

0 commit comments

Comments
 (0)