提交 7e4b1726 编写于 作者: K kohsuke

marked JDK6 dependencies explicitly

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13259 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f37a30dc
......@@ -41,6 +41,7 @@ import org.kohsuke.stapler.Ancestor;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.jvnet.animal_sniffer.IgnoreJRERequirement;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
......@@ -631,6 +632,7 @@ public class Functions {
return Thread.getAllStackTraces();
}
@IgnoreJRERequirement
public static ThreadInfo[] getThreadInfos() {
ThreadMXBean mbean = ManagementFactory.getThreadMXBean();
return mbean.getThreadInfo(mbean.getAllThreadIds(),mbean.isObjectMonitorUsageSupported(),mbean.isSynchronizerUsageSupported());
......@@ -639,6 +641,7 @@ public class Functions {
/**
* Are we running on JRE6 or above?
*/
@IgnoreJRERequirement
public static boolean isMustangOrAbove() {
try {
System.console();
......@@ -649,6 +652,7 @@ public class Functions {
}
// ThreadInfo.toString() truncates the stack trace by first 8, so needed my own version
@IgnoreJRERequirement
public static String dumpThreadInfo(ThreadInfo ti) {
StringBuilder sb = new StringBuilder("\"" + ti.getThreadName() + "\"" +
" Id=" + ti.getThreadId() + " " +
......
......@@ -14,6 +14,7 @@ import org.apache.tools.ant.taskdefs.Chmod;
import org.apache.tools.ant.taskdefs.Copy;
import org.apache.commons.lang.time.FastDateFormat;
import org.kohsuke.stapler.Stapler;
import org.jvnet.animal_sniffer.IgnoreJRERequirement;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
......@@ -206,6 +207,7 @@ public class Util {
/**
* Makes the given file writable.
*/
@IgnoreJRERequirement
private static void makeWritable(File f) {
// try chmod. this becomes no-op if this is not Unix.
try {
......
......@@ -7,6 +7,7 @@ import hudson.model.Computer;
import hudson.remoting.VirtualChannel;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import org.jvnet.animal_sniffer.IgnoreJRERequirement;
import java.io.File;
import java.io.IOException;
......@@ -71,6 +72,7 @@ public class DiskSpaceMonitor extends NodeMonitor {
};
private static final class GetUsableSpace implements FileCallable<Long> {
@IgnoreJRERequirement
public Long invoke(File f, VirtualChannel channel) throws IOException {
try {
return f.getUsableSpace();
......
......@@ -14,6 +14,8 @@ import java.io.StringReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.jvnet.animal_sniffer.IgnoreJRERequirement;
/**
* Used to build up arguments for a process invocation.
*
......@@ -92,6 +94,14 @@ public class ArgumentListBuilder implements Serializable {
public ArgumentListBuilder addKeyValuePairsFromPropertyString(String prefix, String properties, VariableResolver vr) throws IOException {
if(properties==null) return this;
for (Entry<Object,Object> entry : load(properties).entrySet()) {
args.add(prefix + entry.getKey() + "=" + Util.replaceMacro(entry.getValue().toString(),vr));
}
return this;
}
@IgnoreJRERequirement
private Properties load(String properties) throws IOException {
Properties p = new Properties();
try {
p.load(new StringReader(properties));
......@@ -101,11 +111,7 @@ public class ArgumentListBuilder implements Serializable {
// 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(prefix + entry.getKey() + "=" + Util.replaceMacro(entry.getValue().toString(),vr));
}
return this;
return p;
}
public String[] toCommandArray() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册