diff options
author | Nassim Jahnke <[email protected]> | 2022-10-01 11:49:27 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-10-01 11:49:27 +0200 |
commit | e9618f878019c50109009f4814efb3589cfbb6a4 (patch) | |
tree | 5323b449155698d5b90b9e8fca5e7b2fe662e186 | |
parent | 2534e5cbbfb062dedbe91046fce42b0de734fa84 (diff) | |
download | Paper-e9618f878019c50109009f4814efb3589cfbb6a4.tar.gz Paper-e9618f878019c50109009f4814efb3589cfbb6a4.zip |
Add system property to dump stack on bad plugin class access (#8417)
-rw-r--r-- | patches/api/0398-Add-system-property-to-print-stacktrace-on-bad-plugi.patch | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/patches/api/0398-Add-system-property-to-print-stacktrace-on-bad-plugi.patch b/patches/api/0398-Add-system-property-to-print-stacktrace-on-bad-plugi.patch new file mode 100644 index 0000000000..a4e596f91f --- /dev/null +++ b/patches/api/0398-Add-system-property-to-print-stacktrace-on-bad-plugi.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke <[email protected]> +Date: Sat, 1 Oct 2022 09:44:26 +0200 +Subject: [PATCH] Add system property to print stacktrace on bad plugin class + access + + +diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +index f7cfe6c0d9d52ed72d0d45baaaf856c15769c668..06daf7e7b9f177256a7a15b91e72ff53f89ccb68 100644 +--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +@@ -162,6 +162,11 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + // In case the bad access occurs on construction + loader.server.getLogger().log(Level.WARNING, "[{0}] Loaded class {1} from {2} which is not a depend or softdepend of this plugin.", new Object[]{description.getName(), name, provider.getFullName()}); + } ++ // Paper start ++ if (Boolean.getBoolean("Paper.printStacktraceOnBadPluginClassAccess")) { ++ new Exception().printStackTrace(); ++ } ++ // Paper end + } + } + |