From f05e8a7b58cbae2db891cc40866a25efba639ec8 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 2 Mar 2010 00:29:09 +0000 Subject: [PATCH 1/1] Acknoledge the fact that JniException is a runtime exception now: kill all its occurences in the examples git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7154 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/java/basic/BasicTest.java | 7 ++----- examples/java/basic/FinalizeTask.java | 10 +++------- examples/java/basic/Forwarder.java | 7 ++----- examples/java/basic/Master.java | 2 +- examples/java/basic/Slave.java | 7 ++----- examples/java/comm_time/CommTimeTest.java | 4 +--- examples/java/comm_time/FinalizeTask.java | 10 +++------- examples/java/comm_time/Master.java | 2 +- examples/java/comm_time/Slave.java | 7 ++----- examples/java/ping_pong/PingPongTask.java | 9 +++------ examples/java/ping_pong/PingPongTest.java | 2 +- examples/java/ping_pong/Receiver.java | 2 +- examples/java/ping_pong/Sender.java | 2 +- examples/java/suspend/DreamMaster.java | 2 +- examples/java/suspend/LazyGuy.java | 7 ++----- examples/java/suspend/SuspendTest.java | 2 +- 16 files changed, 27 insertions(+), 55 deletions(-) diff --git a/examples/java/basic/BasicTest.java b/examples/java/basic/BasicTest.java index 5d34c69d4a..89921ae918 100644 --- a/examples/java/basic/BasicTest.java +++ b/examples/java/basic/BasicTest.java @@ -1,8 +1,5 @@ /* - * $Id$ - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All rights reserved. + * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. @@ -17,7 +14,7 @@ public class BasicTest { * which also contains such a launcher */ - public static void main(String[] args) throws JniException, NativeException { + public static void main(String[] args) throws NativeException { /* initialize the MSG simulation. Must be done before anything else (even logging). */ Msg.init(args); diff --git a/examples/java/basic/FinalizeTask.java b/examples/java/basic/FinalizeTask.java index 274ecd5fbc..3764382617 100644 --- a/examples/java/basic/FinalizeTask.java +++ b/examples/java/basic/FinalizeTask.java @@ -1,8 +1,5 @@ /* - * $Id: CommTimeTask.java 3685 2007-07-08 21:02:03Z mquinson $ - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All rights reserved. + * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. @@ -10,9 +7,8 @@ import simgrid.msg.*; -public class FinalizeTask extends Task { - - public FinalizeTask() throws JniException, NativeException{ +public class FinalizeTask extends Task { + public FinalizeTask() { super("finalize",0,0); } } diff --git a/examples/java/basic/Forwarder.java b/examples/java/basic/Forwarder.java index dd69021aff..46d1186d57 100644 --- a/examples/java/basic/Forwarder.java +++ b/examples/java/basic/Forwarder.java @@ -1,8 +1,5 @@ /* - * $Id$ - * - * Copyright 2006,2007,2010 The SimGrid Team - * All rights reserved. + * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. @@ -12,7 +9,7 @@ import simgrid.msg.*; public class Forwarder extends simgrid.msg.Process { - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { if (args.length < 3) { Msg.info("Forwarder needs 3 arguments (input mailbox, first output mailbox, last one)"); Msg.info("Got "+args.length+" instead"); diff --git a/examples/java/basic/Master.java b/examples/java/basic/Master.java index 2b4ef9a253..90e55dca73 100644 --- a/examples/java/basic/Master.java +++ b/examples/java/basic/Master.java @@ -10,7 +10,7 @@ import simgrid.msg.*; public class Master extends simgrid.msg.Process { - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { if (args.length < 4) { Msg.info("Master needs 4 arguments"); System.exit(1); diff --git a/examples/java/basic/Slave.java b/examples/java/basic/Slave.java index d2bb15d32b..4249fdb019 100644 --- a/examples/java/basic/Slave.java +++ b/examples/java/basic/Slave.java @@ -1,8 +1,5 @@ /* - * $Id$ - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All rights reserved. + * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. @@ -11,7 +8,7 @@ import simgrid.msg.*; public class Slave extends simgrid.msg.Process { - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { if (args.length < 1) { Msg.info("Slave needs 1 argument (its number)"); System.exit(1); diff --git a/examples/java/comm_time/CommTimeTest.java b/examples/java/comm_time/CommTimeTest.java index 4ff274af48..ef31c0baa2 100644 --- a/examples/java/comm_time/CommTimeTest.java +++ b/examples/java/comm_time/CommTimeTest.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright 2006,2007,2010 The SimGrid Team. All right reserved. * * This program is free software; you can redistribute it and/or modify it @@ -17,7 +15,7 @@ public class CommTimeTest { * which also contains such a launcher */ - public static void main(String[] args) throws JniException, NativeException { + public static void main(String[] args) throws NativeException { /* initialize the MSG simulation. Must be done before anything else (even logging). */ Msg.init(args); diff --git a/examples/java/comm_time/FinalizeTask.java b/examples/java/comm_time/FinalizeTask.java index c3a10b3472..b7878fd75f 100644 --- a/examples/java/comm_time/FinalizeTask.java +++ b/examples/java/comm_time/FinalizeTask.java @@ -1,8 +1,5 @@ /* - * $Id: CommTimeTask.java 3685 2007-07-08 21:02:03Z mquinson $ - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All rights reserved. + * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. @@ -10,9 +7,8 @@ import simgrid.msg.*; -public class FinalizeTask extends Task { - - public FinalizeTask() throws JniException, NativeException{ +public class FinalizeTask extends Task { + public FinalizeTask() { super("",0,0); } } diff --git a/examples/java/comm_time/Master.java b/examples/java/comm_time/Master.java index 7f3b5c725b..38ca35b522 100644 --- a/examples/java/comm_time/Master.java +++ b/examples/java/comm_time/Master.java @@ -10,7 +10,7 @@ import simgrid.msg.*; public class Master extends simgrid.msg.Process { - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { if (args.length < 4) { Msg.info("Master needs 4 arguments"); System.exit(1); diff --git a/examples/java/comm_time/Slave.java b/examples/java/comm_time/Slave.java index e9069ad997..df6b84aa38 100644 --- a/examples/java/comm_time/Slave.java +++ b/examples/java/comm_time/Slave.java @@ -1,8 +1,5 @@ /* - * $Id$ - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All rights reserved. + * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. @@ -11,7 +8,7 @@ import simgrid.msg.*; public class Slave extends simgrid.msg.Process { - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { if (args.length < 1) { Msg.info("Slave needs 1 argument (its number)"); System.exit(1); diff --git a/examples/java/ping_pong/PingPongTask.java b/examples/java/ping_pong/PingPongTask.java index 62c178aad6..79fa7d2cd7 100644 --- a/examples/java/ping_pong/PingPongTask.java +++ b/examples/java/ping_pong/PingPongTask.java @@ -1,8 +1,5 @@ /* - * $Id$ - * - * Copyright 2006,2007 Martin Quinson, Malek Cherier - * All rights reserved. + * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. @@ -14,11 +11,11 @@ public class PingPongTask extends Task { private double timeVal; - public PingPongTask() throws JniException, NativeException { + public PingPongTask() throws NativeException { this.timeVal = 0; } - public PingPongTask(String name, double computeDuration, double messageSize) throws JniException, NativeException { + public PingPongTask(String name, double computeDuration, double messageSize) throws NativeException { super(name,computeDuration,messageSize); } diff --git a/examples/java/ping_pong/PingPongTest.java b/examples/java/ping_pong/PingPongTest.java index c92750bfb8..48c86b13b0 100644 --- a/examples/java/ping_pong/PingPongTest.java +++ b/examples/java/ping_pong/PingPongTest.java @@ -17,7 +17,7 @@ public class PingPongTest { * which also contains such a launcher */ - public static void main(String[] args) throws JniException, NativeException { + public static void main(String[] args) throws NativeException { /* initialize the MSG simulation. Must be done before anything else (even logging). */ Msg.init(args); diff --git a/examples/java/ping_pong/Receiver.java b/examples/java/ping_pong/Receiver.java index 1f0cf4ea7e..e432c90080 100644 --- a/examples/java/ping_pong/Receiver.java +++ b/examples/java/ping_pong/Receiver.java @@ -15,7 +15,7 @@ public class Receiver extends simgrid.msg.Process { final double commSizeLat = 1; final double commSizeBw = 100000000; - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { Msg.info("hello!"); double communicationTime=0; diff --git a/examples/java/ping_pong/Sender.java b/examples/java/ping_pong/Sender.java index 846566fcc3..eca3688fa1 100644 --- a/examples/java/ping_pong/Sender.java +++ b/examples/java/ping_pong/Sender.java @@ -14,7 +14,7 @@ public class Sender extends simgrid.msg.Process { private final double commSizeLat = 1; final double commSizeBw = 100000000; - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { Msg.info("hello!"); diff --git a/examples/java/suspend/DreamMaster.java b/examples/java/suspend/DreamMaster.java index 5a9164c6b1..9f7cb70757 100644 --- a/examples/java/suspend/DreamMaster.java +++ b/examples/java/suspend/DreamMaster.java @@ -11,7 +11,7 @@ import simgrid.msg.*; public class DreamMaster extends simgrid.msg.Process { - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { Msg.info("Hello !"); Msg.info("Let's create a lazy guy."); diff --git a/examples/java/suspend/LazyGuy.java b/examples/java/suspend/LazyGuy.java index 5dcaf01d40..e31bae0ba3 100644 --- a/examples/java/suspend/LazyGuy.java +++ b/examples/java/suspend/LazyGuy.java @@ -1,6 +1,4 @@ /* - * $Id$ - * * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. * * This program is free software; you can redistribute it and/or modify it @@ -14,14 +12,13 @@ public class LazyGuy extends simgrid.msg.Process { super(); } - public LazyGuy(Host host,String name) - throws NullPointerException, HostNotFoundException, JniException, NativeException + public LazyGuy(Host host,String name) throws HostNotFoundException, NativeException { super(host,name,null); } - public void main(String[] args) throws JniException, NativeException { + public void main(String[] args) throws NativeException { Msg.info("Hello !"); Msg.info("Nobody's watching me ? Let's go to sleep."); diff --git a/examples/java/suspend/SuspendTest.java b/examples/java/suspend/SuspendTest.java index 4a4cbffc59..60acfd160a 100644 --- a/examples/java/suspend/SuspendTest.java +++ b/examples/java/suspend/SuspendTest.java @@ -13,7 +13,7 @@ import simgrid.msg.*; public class SuspendTest { - public static void main(String[] args) throws JniException, NativeException { + public static void main(String[] args) throws NativeException { /* initialize the MSG simulation. Must be done before anything else (even logging). */ Msg.init(args); -- 2.20.1