2021-11-26 23:11:17 +00:00
|
|
|
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
|
2022-03-01 05:43:03 +00:00
|
|
|
index ad49b5a0b3d7fb104eda273368e5ad1e2b1453dc..6d62358239b3e2ba653e439cea918dcbc9059775 100644
|
2021-11-26 23:11:17 +00:00
|
|
|
--- a/src/main/java/net/minecraft/Util.java
|
|
|
|
+++ b/src/main/java/net/minecraft/Util.java
|
2021-12-10 14:24:07 +00:00
|
|
|
@@ -23,7 +23,6 @@ import java.net.URL;
|
2021-11-26 23:11:17 +00:00
|
|
|
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;
|
2022-03-01 05:43:03 +00:00
|
|
|
@@ -764,21 +763,7 @@ public class Util {
|
2021-11-26 23:11:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void openUrl(URL url) {
|
|
|
|
- try {
|
|
|
|
- Process process = AccessController.doPrivileged((PrivilegedExceptionAction<Process>)(() -> {
|
|
|
|
- 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
|
|
|
|
|
|
|
|
}
|
|
|
|
|