From d168103630085e9f0e70e038dcdc80d8ca7817a2 Mon Sep 17 00:00:00 2001 From: mquinson Date: Tue, 9 Feb 2010 16:36:25 +0000 Subject: [PATCH] Hello java 5 git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7069 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/java/simgrid/msg/ApplicationHandler.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/java/simgrid/msg/ApplicationHandler.java b/src/java/simgrid/msg/ApplicationHandler.java index 47c29eef94..4ece14d5fb 100644 --- a/src/java/simgrid/msg/ApplicationHandler.java +++ b/src/java/simgrid/msg/ApplicationHandler.java @@ -37,9 +37,9 @@ public final class ApplicationHandler { * The vector which contains the arguments of the main function * of the process object. */ - public Vector args; + public Vector args; - public Hashtable properties; + public Hashtable properties; /** * The name of the host of the process. @@ -56,8 +56,8 @@ public final class ApplicationHandler { * Default constructor. */ public ProcessFactory() { - this.args = new Vector(); - this.properties = new Hashtable(); + this.args = new Vector(); + this.properties = new Hashtable(); this.hostName = null; this.function = null; } @@ -102,12 +102,12 @@ public final class ApplicationHandler { return hostName; } + @SuppressWarnings("unchecked") public void createProcess() { try { + Class cls = (Class) Class.forName(this.function); - Class cls = Class.forName(this.function); - - simgrid.msg.Process process = (simgrid.msg.Process) cls.newInstance(); + simgrid.msg.Process process = cls.newInstance(); process.name = this.function; process.id = simgrid.msg.Process.nextProcessId++; Host host = Host.getByName(this.hostName); @@ -136,7 +136,7 @@ public final class ApplicationHandler { } catch(ClassNotFoundException e) { System.out.println(this.function + - " class not found\n The attribut function of the element process of your deployment file\n must correspond to the name of a Msg Proces class)"); + " class not found\n The attribut function of the element process of your deployment file\n must correspond to the name of a Msg Proces class)"); e.printStackTrace(); } catch(InstantiationException e) { -- 2.20.1