X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4ae09f4ec3af8962f2e297646c5e092f2f01be64..55f40bb2267b2fb4999d7c3ec1a69b4ef133fe68:/src/bindings/java/org/simgrid/msg/VM.java diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java index 6752b0b6ae..9f78fa4435 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,38 +46,27 @@ 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