mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-24 13:30:48 +01:00
Remove client-side code using deprecated for removal
AccessController Fixes warnings on build
This commit is contained in:
parent
04ca580aa6
commit
01afd3826e
1 changed files with 43 additions and 0 deletions
|
@ -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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/Util.java
|
||||||
|
+++ b/src/main/java/net/minecraft/Util.java
|
||||||
|
@@ -0,0 +0,0 @@ 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;
|
||||||
|
@@ -0,0 +0,0 @@ public class Util {
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue