X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9dbeb2372ad9a123d0558132ebb6e003e10aa641..611d822b02f836d7abe031cced6adc4281ef4356:/src/bindings/java/org/simgrid/msg/RngStream.java diff --git a/src/bindings/java/org/simgrid/msg/RngStream.java b/src/bindings/java/org/simgrid/msg/RngStream.java index 9e0ec6f08d..1fb6085839 100644 --- a/src/bindings/java/org/simgrid/msg/RngStream.java +++ b/src/bindings/java/org/simgrid/msg/RngStream.java @@ -1,6 +1,6 @@ /* JNI interface to C RngStream code */ -/* Copyright (c) 2006-2014. The SimGrid Team. +/* Copyright (c) 2006-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -16,7 +16,7 @@ public class RngStream { */ private long bind; /** - * Creates and returns a new stream without identifier. + * Creates and returns a new stream without identifier. * This procedure reserves space to keep the information relative to * the RngStream, initializes its seed Ig , sets Bg and Cg equal to Ig , sets its antithetic and * precision switches to 0. The seed Ig is equal to the initial seed of the package given by @@ -27,7 +27,7 @@ public class RngStream { create(""); } /** - * Creates and returns a new stream with identifier "name". + * Creates and returns a new stream with identifier "name". * This procedure reserves space to keep the information relative to * the RngStream, initializes its seed Ig , sets Bg and Cg equal to Ig , sets its antithetic and * precision switches to 0. The seed Ig is equal to the initial seed of the package given by @@ -41,13 +41,10 @@ public class RngStream { * The natively implemented method to create a C RngStream object. */ private native void create(String name); + @Override - protected void finalize() { - try { - nativeFinalize(); - } catch (Throwable e) { - e.printStackTrace(); - } + protected void finalize() throws Throwable{ + nativeFinalize(); } /** * Release the C RngStream object @@ -61,7 +58,7 @@ public class RngStream { * must all be less than m1 = 4294967087, and not all 0; and the last 3 values must all be less * than m2 = 4294944443, and not all 0. Returns false for invalid seeds, and true otherwise. */ - public static native boolean setPackageSeed(int seed[]); + public static native boolean setPackageSeed(int[] seed); /** * Reinitializes the stream g to its initial state: Cg and Bg are set to Ig . */ @@ -87,12 +84,12 @@ public class RngStream { * the initial seeds of the streams are no longer spaced Z values apart. We discourage the use of * this procedure. Returns false for invalid seeds, and true otherwise. */ - public native boolean setSeed(int seed[]); + public native boolean setSeed(int[] seed); /** * Advances the state of the stream by k values, without modifying the states of other streams (as * in RngStream_SetSeed), nor the values of Bg and Ig associated with this stream. If e > 0, then * k = 2e + c; if e < 0, then k = -2-e + c; and if e = 0, then k = c. Note: c is allowed to take - * negative values. We discourage the use of this procedure. + * negative values. We discourage the use of this procedure. */ public native void advanceState(int e, int g); @@ -113,7 +110,7 @@ public class RngStream { */ public static native void nativeInit(); static { - Msg.nativeInit(); + org.simgrid.NativeLib.nativeInit(); nativeInit(); } }