goeclipse不能保存项目配置
无    2014-03-03 17:08:48    730    0    0
life

修改Environment.Java

Properties properties2 = new Properties();
for (Map.Entry & lt; Object, Object & gt; o: properties.entrySet()) {
    properties2.setProperty(o.getKey().toString(), o.getValue().toString());
}

properties2.storeToXML(new FileOutputStream(path.toOSString() + "/properties.xml", false), project.getName() + " properties", "utf-8");

原因:

感觉很奇怪, 调试进Properties的代码看了一下.

public String getProperty(String key) {
    Object oval = super.get(key);
    String sval = (oval instanceof String) ? (String)oval : null;
    return ((sval == null) && (defaults != null)) ? defaults.getProperty(key) : sval;
}

原来Properties这货, 不是String的属性.

上一篇: goclipse 修改

下一篇: golang 正则

730 人读过