X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7da2926d0733ff0683f31aeea176ce71e127264f..dccf1b41e9c7b5a696f01abceaa2779fe65f154f:/src/bindings/java/org/simgrid/msg/Semaphore.java diff --git a/src/bindings/java/org/simgrid/msg/Semaphore.java b/src/bindings/java/org/simgrid/msg/Semaphore.java index 0172aa3b03..4f23563f34 100644 --- a/src/bindings/java/org/simgrid/msg/Semaphore.java +++ b/src/bindings/java/org/simgrid/msg/Semaphore.java @@ -34,6 +34,7 @@ public class Semaphore { /** Locks on the semaphore object until the provided timeout expires * @exception TimeoutException if the timeout expired before * the semaphore could be acquired. + * @param timeout the duration of the lock */ public native void acquire(double timeout) throws TimeoutException; /** Locks on the semaphore object with no timeout @@ -42,8 +43,8 @@ public class Semaphore { try { acquire(-1); } catch (TimeoutException e) { - // This should not happen. - assert(false); + e.printStackTrace(); // This should not happen. + assert false ; } } /** Releases the semaphore object @@ -66,13 +67,8 @@ public class Semaphore { /** Deletes this semaphore when the GC reclaims it */ - @Override - protected void finalize() { - try { - nativeFinalize(); - } catch (Throwable e) { - e.printStackTrace(); - } + protected void finalize() throws Throwable { + nativeFinalize(); } private native void nativeFinalize(); /**