throw ExceptionHandling.dieInternal(tc, t);
}
}
public static SixModelObject jvmgetproperties(ThreadContext tc) {
SixModelObject hashType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.hashType;
SixModelObject strType = tc.curFrame.codeRef.staticInfo.compUnit.hllConfig.strBoxType;
SixModelObject res = hashType.st.REPR.allocate(tc, hashType.st);
Properties env = System.getProperties();
for (String envName : env.stringPropertyNames()) {
String propVal = env.getProperty(envName);
if (envName.equals("os.name")) {
// Normalize OS name (some cases likely missing).
String pvlc = propVal.toLowerCase();
if (pvlc.indexOf("win") >= 0)
propVal = "MSWin32";
else if (pvlc.indexOf("mac os x") >= 0)
propVal = "darwin";
}
res.bind_key_boxed(tc, envName, box_s(propVal, strType, tc));
}
return res;
}