3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-09-29 06:30:16 +02:00

remove access controller (#1306)

Dieser Commit ist enthalten in:
powercas_gamer 2024-04-24 22:13:09 +02:00 committet von GitHub
Ursprung f98c522fa6
Commit 2534412be4
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 4 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -74,9 +74,7 @@ import java.net.InetSocketAddress;
import java.net.http.HttpClient; import java.net.http.HttpClient;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.security.AccessController;
import java.security.KeyPair; import java.security.KeyPair;
import java.security.PrivilegedAction;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Locale; import java.util.Locale;
@ -522,8 +520,8 @@ public class VelocityServer implements ProxyServer, ForwardingAudience {
// makes sure that all the disconnect events are being fired // makes sure that all the disconnect events are being fired
CompletableFuture<Void> playersTeardownFuture = CompletableFuture.allOf(players.stream() CompletableFuture<Void> playersTeardownFuture = CompletableFuture.allOf(players.stream()
.map(ConnectedPlayer::getTeardownFuture) .map(ConnectedPlayer::getTeardownFuture)
.toArray((IntFunction<CompletableFuture<Void>[]>) CompletableFuture[]::new)); .toArray((IntFunction<CompletableFuture<Void>[]>) CompletableFuture[]::new));
playersTeardownFuture.get(10, TimeUnit.SECONDS); playersTeardownFuture.get(10, TimeUnit.SECONDS);
} catch (TimeoutException e) { } catch (TimeoutException e) {
@ -552,14 +550,7 @@ public class VelocityServer implements ProxyServer, ForwardingAudience {
shutdown = true; shutdown = true;
if (explicitExit) { if (explicitExit) {
AccessController.doPrivileged(new PrivilegedAction<Void>() { System.exit(0);
@Override
@SuppressFBWarnings("DM_EXIT")
public Void run() {
System.exit(0);
return null;
}
});
} }
}; };

Datei anzeigen

@ -38,8 +38,6 @@ import java.net.URL;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.HashSet; import java.util.HashSet;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
@ -92,8 +90,7 @@ public class JavaPluginLoader implements PluginLoader {
URL pluginJarUrl = candidate.getSource().orElseThrow( URL pluginJarUrl = candidate.getSource().orElseThrow(
() -> new InvalidPluginException("Description provided does not have a source path") () -> new InvalidPluginException("Description provided does not have a source path")
).toUri().toURL(); ).toUri().toURL();
PluginClassLoader loader = AccessController.doPrivileged( PluginClassLoader loader = new PluginClassLoader(new URL[]{pluginJarUrl});
(PrivilegedAction<PluginClassLoader>) () -> new PluginClassLoader(new URL[]{pluginJarUrl}));
loader.addToClassloaders(); loader.addToClassloaders();
JavaVelocityPluginDescriptionCandidate candidateInst = JavaVelocityPluginDescriptionCandidate candidateInst =