mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-07 09:06:03 +00:00
[JENKINS-72028] replace deprecated URL() at core/src/main/java/hudson/ (#8565)
* missing 'alt' attribute added
* missing 'alt' attribute added
* replaced 'new URL' to 'new URI' per Java 11 target codebase
* Revert "replaced 'new URL' to 'new URI' per Java 11 target codebase"
This reverts commit aeef4c1e4b.
* replaced deprecated URL() with URI#.toURL()
* updated code per review
* updated
* updated code
* added back file
* Update core/src/main/java/hudson/cli/InstallPluginCommand.java
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
* Update core/src/main/java/hudson/TcpSlaveAgentListener.java
remove non required as per suggestion
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
* Update core/src/main/java/hudson/model/UpdateSite.java
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
* Update core/src/main/java/hudson/model/UpdateSite.java
* Spotless
---------
Co-authored-by: Alexander Brandes <mc.cache@web.de>
Co-authored-by: James Nord <jtnord@users.noreply.github.com>
This commit is contained in:
10 files changed
+111
-52
No files matched your search
@@ -110,7 +110,6 @@ import java.lang.reflect.Type;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -1939,11 +1938,11 @@ public class Functions {
|
||||
String url = Jenkins.get().getRootUrl();
|
||||
try {
|
||||
if (url != null) {
|
||||
String host = new URL(url).getHost();
|
||||
String host = new URI(url).toURL().getHost();
|
||||
if (host != null)
|
||||
return host;
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
} catch (MalformedURLException | URISyntaxException e) {
|
||||
// fall back to HTTP request
|
||||
}
|
||||
return Stapler.getCurrentRequest().getServerName();
|
||||
|
||||
Reference in new issue
Block a user