Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Set static field from static method.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 3 Jul 2019 12:21:02 +0000 (14:21 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 3 Jul 2019 12:21:08 +0000 (14:21 +0200)
examples/deprecated/java/process/migration/Emigrant.java
examples/deprecated/java/process/migration/Main.java

index aba8341..7ca62cb 100644 (file)
@@ -33,11 +33,10 @@ public class Emigrant extends Process {
     migrate(Host.getByName("Boivin"));
     waitFor(4);
 
-    Main.processToMigrate = this;
     Main.mutex.release();
     suspend();
 
     Msg.info("I've been moved on this new host:" + getHost().getName());
     Msg.info("Uh, nothing to do here. Stopping now");
   }
-}
\ No newline at end of file
+}
index 70a0afc..e7f1ae9 100644 (file)
@@ -36,6 +36,7 @@ class Main {
         policeman.start();
         Emigrant emigrant   = new Emigrant("Jacquelin","emigrant");
         emigrant.start();
+        processToMigrate = emigrant;
     } catch (HostNotFoundException e){
       Msg.error("Create processes failed!");
       e.printStackTrace();