提交 4969c7b1 编写于 作者: K kohsuke

fix #884.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@5088 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d44287eb
......@@ -19,6 +19,7 @@ import java.io.File;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.io.ByteArrayInputStream;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
......@@ -125,7 +126,14 @@ public class Ant extends Builder {
if (properties != null) {
Properties p = new Properties();
p.load(new StringReader(properties));
try {
p.load(new StringReader(properties));
} catch (NoSuchMethodError e) {
// load(Reader) method is only available on JDK6.
// this fall back version doesn't work correctly with non-ASCII characters,
// but there's no other easy ways out it seems.
p.load(new ByteArrayInputStream(properties.getBytes()));
}
for (Entry<Object,Object> entry : p.entrySet()) {
args.add("-D" + entry.getKey() + "=" + entry.getValue());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册