From: Frederic Suter Date: Mon, 30 May 2016 20:01:38 +0000 (+0200) Subject: Java comes with data structures, use them. X-Git-Tag: v3_14~1092 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/11831064373ded4fb4f294f3a579f7c4915bc23e Java comes with data structures, use them. --- diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java index 6752b0b6ae..cd2c7e81ab 100644 --- a/src/bindings/java/org/simgrid/msg/VM.java +++ b/src/bindings/java/org/simgrid/msg/VM.java @@ -7,7 +7,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; - +import java.util.Vector; public class VM extends Host{ // Please note that we are not declaring a new bind variable @@ -17,7 +17,7 @@ public class VM extends Host{ // GetByName is inherited from the super class Host - private static VM[] vms=null; + private static Vector vms= new Vector<>(); private Host currentHost; /* Constructors / destructors */ @@ -46,30 +46,19 @@ public class VM extends Host{ super.name = name; this.currentHost = host; create(host, name, nCore, ramSize, netCap, diskPath, diskSize, migNetSpeed, dpIntensity); - VM.addVM(this); + vms.add(this); } - private static void addVM(VM vm){ - VM[] vmsN=null; - int i=0; - if(VM.vms == null) - vmsN = new VM[1]; - else - vmsN = new VM[vms.length+1]; - - for (i=0; i