From 7abff79737d1a417422af9ce97ad75670687f4dd Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 26 Nov 2021 15:11:17 -0800 Subject: [PATCH] Remove client-side code using deprecated for removal AccessController Fixes warnings on build --- ...de-code-using-deprecated-for-removal.patch | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 patches/server/0809-Remove-client-side-code-using-deprecated-for-removal.patch diff --git a/patches/server/0809-Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/0809-Remove-client-side-code-using-deprecated-for-removal.patch new file mode 100644 index 0000000000..368687d252 --- /dev/null +++ b/patches/server/0809-Remove-client-side-code-using-deprecated-for-removal.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> +Date: Fri, 26 Nov 2021 15:09:58 -0800 +Subject: [PATCH] Remove client-side code using deprecated for removal + AccessController + +Fixes warnings on build + +diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java +index faffd25b11836915764add5c6afd63cfe424979a..fbbf531c187ddd315a34cc97793daa33cbe60feb 100644 +--- a/src/main/java/net/minecraft/Util.java ++++ b/src/main/java/net/minecraft/Util.java +@@ -21,7 +21,6 @@ import java.net.URL; + import java.nio.file.Files; + import java.nio.file.Path; + import java.nio.file.spi.FileSystemProvider; +-import java.security.AccessController; + import java.security.PrivilegedActionException; + import java.security.PrivilegedExceptionAction; + import java.time.Duration; +@@ -746,21 +745,7 @@ public class Util { + } + + public void openUrl(URL url) { +- try { +- Process process = AccessController.doPrivileged((PrivilegedExceptionAction)(() -> { +- return Runtime.getRuntime().exec(this.getOpenUrlArguments(url)); +- })); +- +- for(String string : IOUtils.readLines(process.getErrorStream())) { +- Util.LOGGER.error(string); +- } +- +- process.getInputStream().close(); +- process.getErrorStream().close(); +- process.getOutputStream().close(); +- } catch (IOException | PrivilegedActionException var5) { +- Util.LOGGER.error("Couldn't open url '{}'", url, var5); +- } ++ throw new IllegalStateException("This method is not useful on dedicated servers."); // Paper + + } +