提交 d3eaff4b 编写于 作者: K kohsuke

improving an error diagnostics for a plugin developer

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17811 71c3de6d-444a-0410-be80-ed276b4c234a
上级 e78ef5c5
......@@ -423,7 +423,10 @@ public abstract class Slave extends Node implements Serializable {
}
public SlaveDescriptor getDescriptor() {
return (SlaveDescriptor)Hudson.getInstance().getDescriptor(getClass());
Descriptor d = Hudson.getInstance().getDescriptor(getClass());
if (d instanceof SlaveDescriptor)
return (SlaveDescriptor) d;
throw new IllegalStateException(d.getClass()+" needs to extend from SlaveDescriptor");
}
public static abstract class SlaveDescriptor extends NodeDescriptor {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册