mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
[JENKINS-57678] - Change getInstance() (deprecated) to get() (#4042)
* Change getInstance() (deprecated) to get() * Reverting modifications according review * Changing for use the variable
This commit is contained in:
1 parent
fa0ba22dec
commit
0e62b68012
238 files changed
+618
-625
No files matched your search
@@ -235,7 +235,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
|
||||
}
|
||||
|
||||
public static XmlFile getXmlFile() {
|
||||
return new XmlFile(XSTREAM, new File(Jenkins.getInstance().getRootDir(), "proxy.xml"));
|
||||
return new XmlFile(XSTREAM, new File(Jenkins.get().getRootDir(), "proxy.xml"));
|
||||
}
|
||||
|
||||
public static ProxyConfiguration load() throws IOException {
|
||||
@@ -332,7 +332,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
|
||||
private static ProxyConfiguration _get() {
|
||||
JenkinsJVM.checkJenkinsJVM();
|
||||
// this code could be called between the JVM flag being set and theInstance initialized
|
||||
Jenkins jenkins = Jenkins.getInstance();
|
||||
Jenkins jenkins = Jenkins.get();
|
||||
return jenkins == null ? null : jenkins.proxy;
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
|
||||
@QueryParameter("userName") String userName, @QueryParameter("password") String password,
|
||||
@QueryParameter("noProxyHost") String noProxyHost) {
|
||||
|
||||
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
|
||||
Jenkins.get().checkPermission(Jenkins.ADMINISTER);
|
||||
|
||||
if (Util.fixEmptyAndTrim(testUrl) == null) {
|
||||
return FormValidation.error(Messages.ProxyConfiguration_TestUrlRequired());
|
||||
|
||||
Reference in new issue
Block a user