Skip to content

Commit

Permalink
Fix static initialization in VMs
Browse files Browse the repository at this point in the history
  • Loading branch information
BeatWolf committed Oct 15, 2018
1 parent b5d1102 commit a134036
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = 'A Java distributed system'

group = "ch.icosys"
archivesBaseName = "popjava"
version = "2.0.0"
version = "2.0.1"
sourceCompatibility = "1.8"
targetCompatibility = "1.8"

Expand Down
27 changes: 20 additions & 7 deletions workspace/popjava/src/ch/icosys/popjava/core/system/POPSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import javassist.util.proxy.ProxyFactory;

import ch.icosys.popjava.core.PopJava;
import ch.icosys.popjava.core.base.POPException;
import ch.icosys.popjava.core.baseobject.ObjectDescription;
Expand All @@ -44,7 +46,6 @@
import ch.icosys.popjava.core.util.Util;
import ch.icosys.popjava.core.util.Util.OSType;
import ch.icosys.popjava.core.util.upnp.UPNPManager;
import javassist.util.proxy.ProxyFactory;

/**
* This class is responsible for the initialization of a POP-Java application.
Expand Down Expand Up @@ -101,14 +102,26 @@ public static void writeLog(String log) {

static {
// Trick :(( I don't know why the system i386 doesn't work
String osName = System.getProperty("os.name");
String osArchitect = System.getProperty("os.arch");
try {
String osName = System.getProperty("os.name");
String osArchitect = System.getProperty("os.arch");

if (osArchitect.contains("64")) {
osArchitect = "x86_64";
}
if(osName == null) {
osName = "";
}

if(osArchitect == null) {
osArchitect = "";
}

if (osArchitect.contains("64")) {
osArchitect = "x86_64";
}

platform = String.format("%s-%s", osArchitect, osName);
platform = String.format("%s-%s", osArchitect, osName);
}catch (Throwable e) {
e.printStackTrace();
}
}

/**
Expand Down

0 comments on commit a134036

Please sign in to comment.