13
0
geforkt von Mirrors/Paper

attempt to allow timings to continue with janky plugin classes

Dieser Commit ist enthalten in:
Shane Freeder 2019-12-15 22:39:25 +00:00
Ursprung 2f8ae01cb1
Commit 5ea670d028

Datei anzeigen

@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
new file mode 100644 new file mode 100644
index 000000000..c6818bc86 index 000000000..69e26a826
--- /dev/null --- /dev/null
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@ -79,10 +79,16 @@ index 000000000..c6818bc86
+ plugin = TimingsManager.getPluginByClassloader(taskClass); + plugin = TimingsManager.getPluginByClassloader(taskClass);
+ } + }
+ +
+ final String taskname = taskNameCache.computeIfAbsent(taskClass, clazz -> + final String taskname = taskNameCache.computeIfAbsent(taskClass, clazz -> {
+ clazz.isAnonymousClass() || clazz.isLocalClass() + try {
+ ? clazz.getName() + return clazz.isAnonymousClass() || clazz.isLocalClass()
+ : clazz.getCanonicalName()); + ? clazz.getName()
+ : clazz.getCanonicalName();
+ } catch (Throwable ex) {
+ new Exception("Error occurred detecting class name", ex).printStackTrace();
+ return "MangledClassFile";
+ }
+ });
+ +
+ StringBuilder name = new StringBuilder(64); + StringBuilder name = new StringBuilder(64);
+ name.append("Task: ").append(taskname); + name.append("Task: ").append(taskname);