Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of ssh://scm.gforge.inria.fr/gitroot/simgrid/simgrid
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 25 Apr 2018 13:44:39 +0000 (15:44 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 25 Apr 2018 13:44:39 +0000 (15:44 +0200)
src/bindings/java/org/simgrid/NativeLib.java

index 3db622c..660158a 100644 (file)
@@ -108,21 +108,19 @@ public final class NativeLib {
                                InputStream in = NativeLib.class.getClassLoader().getResourceAsStream(path+filename);
                                OutputStream out = new FileOutputStream(fileOut);
                        ) {
-                               if (in == null)
-                                       continue; // Try the next name: no such file found
-                               
-                               /* copy the library in position */
-                               byte[] buffer = new byte[4096];
-                               int bytesRead;
-                               while ((bytesRead = in.read(buffer)) != -1)     // Read until EOF
-                                       out.write(buffer, 0, bytesRead);
-                               
-                               done = true;
+                               if (in != null) {
+                                       /* copy the library in position */
+                                       byte[] buffer = new byte[4096];
+                                       int bytesRead;
+                                       while ((bytesRead = in.read(buffer)) != -1)     // Read until EOF
+                                               out.write(buffer, 0, bytesRead);
+                                       done = true;
+                               }
                        }
                        if (done) {
-                               /* load that shit */
+                               /* load that library */
                                System.load(fileOut.getAbsolutePath());
-                               
+
                                /* It loaded! we're good */
                                return true;
                        }