Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deprecated api usage #76

Merged
merged 1 commit into from
Nov 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public final class WorkspaceActionImpl extends WorkspaceAction implements FlowNo
@SuppressFBWarnings(value="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE", justification="TODO 1.653+ switch to Jenkins.getInstanceOrNull")
public WorkspaceActionImpl(FilePath workspace, FlowNode parent) {
node = FilePathUtils.getNodeName(workspace);
Jenkins j = Jenkins.getInstance();
Jenkins j = Jenkins.getInstanceOrNull();
Node n = j == null ? null : node.isEmpty() ? j : j.getNode(node);
labels = new TreeSet<LabelAtom>();
if (n != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public POSTHyperlinkNote(String url, int length) {
if (req != null) {
url = req.getContextPath() + url;
} else {
Jenkins j = Jenkins.getInstance();
Jenkins j = Jenkins.getInstanceOrNull();
if (j != null) {
String rootUrl = j.getRootUrl();
if (rootUrl != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public final class SemaphoreStep extends AbstractStepImpl implements Serializabl
private static final class State {
private static final Map<File,State> states = new HashMap<File,State>();
static synchronized State get() {
File home = Jenkins.getActiveInstance().getRootDir();
File home = Jenkins.get().getRootDir();
State state = states.get(home);
if (state == null) {
state = new State();
Expand Down