Revert "Jenkins.getInstance() should be non-null"

This reverts commit bb7c8fcedb.

Closes #2090, I'll redo this as a PR... though if that PR is subject to multiple rounds of review before being merged then I will take that of evidence of the exact problem that committing directly was supposed to resolve... namely exponentially multiplying the effort required to make actual improvements to the code base.
This commit is contained in:
Stephen Connolly committed 2016-03-08 21:09:28 +00:00
1 parent 074890c093
commit d1dfbd2baf
42 files changed
+78 -99

No files matched your search

@@ -215,7 +215,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
* This method should be used wherever {@link URL#openConnection()} to internet URLs is invoked directly.
*/
public static URLConnection open(URL url) throws IOException {
Jenkins h = Jenkins.getInstanceOrNull(); // this code might run on slaves
Jenkins h = Jenkins.getInstance(); // this code might run on slaves
ProxyConfiguration p = h!=null ? h.proxy : null;
if(p==null)
return url.openConnection();
@@ -241,7 +241,7 @@ public final class ProxyConfiguration extends AbstractDescribableImpl<ProxyConfi
}
public static InputStream getInputStream(URL url) throws IOException {
Jenkins h = Jenkins.getInstanceOrNull(); // this code might run on slaves
Jenkins h = Jenkins.getInstance(); // this code might run on slaves
final ProxyConfiguration p = (h != null) ? h.proxy : null;
if (p == null)
return new RetryableHttpStream(url);