Skip to content

Commit

Permalink
workaround JENKINS-48505 JDK-8184907
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted Xiao committed Dec 13, 2017
1 parent 36bd847 commit 10c7ca8
Showing 1 changed file with 6 additions and 8 deletions.
Expand Up @@ -99,16 +99,14 @@ public SplunkJenkinsInstallation() {
}

public static SplunkJenkinsInstallation get() {
if (cachedConfig != null) {
return cachedConfig;
} else {
if (Jenkins.getInstance() != null && GlobalConfiguration.all() != null) {
return GlobalConfiguration.all().get(SplunkJenkinsInstallation.class);
} else {
//jenkins is in shutdown phase
throw new IllegalStateException("Jenkins has not been started, or was already shut down");
if (cachedConfig == null) {
synchronized (SplunkJenkinsInstallation.class) {
if (cachedConfig == null) {
cachedConfig = (SplunkJenkinsInstallation) Jenkins.getActiveInstance().getDescriptor(SplunkJenkinsInstallation.class);
}
}
}
return cachedConfig;
}

/**
Expand Down

0 comments on commit 10c7ca8

Please sign in to comment.