提交 b29a6a1d 编写于 作者: K kohsuke

fixed initialization order bug.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9421 71c3de6d-444a-0410-be80-ed276b4c234a
上级 8bd14e50
......@@ -30,9 +30,7 @@ public abstract class RetentionStrategy<T extends Computer> implements Describab
/**
* All registered {@link RetentionStrategy} implementations.
*/
public static final DescriptorList<RetentionStrategy<?>> LIST = new DescriptorList<RetentionStrategy<?>>(
Always.DESCRIPTOR
);
public static final DescriptorList<RetentionStrategy<?>> LIST = new DescriptorList<RetentionStrategy<?>>();
/**
* Dummy instance that doesn't do any attempt to retention.
......@@ -46,7 +44,12 @@ public abstract class RetentionStrategy<T extends Computer> implements Describab
throw new UnsupportedOperationException();
}
};
/**
* Convenient singleton instance, sine this {@link RetentionStrategy} is stateless.
*/
public static final Always INSTANCE = new Always();
/**
* {@link RetentionStrategy} that tries to keep the node online all the time.
*/
......@@ -61,11 +64,6 @@ public abstract class RetentionStrategy<T extends Computer> implements Describab
return 1;
}
/**
* Convenient singleton instance, sine this {@link RetentionStrategy} is stateless.
*/
public static final Always INSTANCE = new Always();
public DescriptorImpl getDescriptor() {
return DESCRIPTOR;
}
......@@ -81,5 +79,9 @@ public abstract class RetentionStrategy<T extends Computer> implements Describab
return "Keep this slave on-line as much as possible";
}
}
static {
LIST.add(DESCRIPTOR);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册