提交 e9772f0f 编写于 作者: S Stephen Connolly

Jenkins.getInstance() is safe to assume non-null

- Only ever called after extensions are on the classpath while performing initialization and during termination before `Jenkins.theInstance` is set to `null`
上级 b0bd44e8
......@@ -116,8 +116,8 @@ abstract class TaskMethodFinder<T extends Annotation> extends TaskBuilder {
*/
private Object lookUp(Class<?> type) {
if (type==Jenkins.class || type==Hudson.class)
return Jenkins.getInstanceOrNull();
Jenkins j = Jenkins.getInstanceOrNull();
return Jenkins.getInstance();
Jenkins j = Jenkins.getInstance();
if (j!=null) {
Injector i = j.getInjector();
if (i!=null)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册