提交 5b754315 编写于 作者: J Jesse Glick

It is Thread.getThreadGroup that can return null, not ThreadGroup.getName.

https://jenkins.ci.cloudbees.com/job/core/job/jenkins_main_trunk/1436/testReport/hudson.model/UpdateCenter2Test/install/
java.lang.NullPointerException: null
	at hudson.Functions$ThreadSorterBase.<init>(Functions.java:1151)
	at hudson.Functions$ThreadSorterBase.<init>(Functions.java:1142)
	at hudson.Functions$ThreadGroupMap.<init>(Functions.java:1163)
	at hudson.Functions.sortThreadsAndGetGroupMap(Functions.java:1136)
	at org.jvnet.hudson.test.JenkinsRule$2.evaluate(JenkinsRule.java:482)
上级 ac5767e3
......@@ -1147,8 +1147,10 @@ public class Functions {
while (tg.getParent() != null) tg = tg.getParent();
Thread[] threads = new Thread[tg.activeCount()*2];
int threadsLen = tg.enumerate(threads, true);
for (int i = 0; i < threadsLen; i++)
map.put(threads[i].getId(), threads[i].getThreadGroup().getName());
for (int i = 0; i < threadsLen; i++) {
ThreadGroup group = threads[i].getThreadGroup();
map.put(threads[i].getId(), group != null ? group.getName() : null);
}
}
protected int compare(long idA, long idB) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册