mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Fix timings task name generation for extreme cases - Fixes #3499
I'm going make a class, and in that class i'm going to make a method. And in that method, I'm going to make a local class. And then in that local class, I'm going to make another inner class. I heard you like complex class trees.
This commit is contained in:
parent
5ba1921c99
commit
5c048e9ae3
@ -81,13 +81,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ final String taskname = taskNameCache.computeIfAbsent(taskClass, clazz -> {
|
||||
+ try {
|
||||
+ String clsName = clazz.isAnonymousClass() || clazz.isLocalClass()
|
||||
+ String clsName = !clazz.isMemberClass()
|
||||
+ ? clazz.getName()
|
||||
+ : clazz.getCanonicalName();
|
||||
+ if (clsName.contains("$Lambda$")) {
|
||||
+ if (clsName != null && clsName.contains("$Lambda$")) {
|
||||
+ clsName = clsName.replaceAll("(Lambda\\$.*?)/.*", "$1");
|
||||
+ }
|
||||
+ return clsName;
|
||||
+ return clsName != null ? clsName : "UnknownTask";
|
||||
+ } catch (Throwable ex) {
|
||||
+ new Exception("Error occurred detecting class name", ex).printStackTrace();
|
||||
+ return "MangledClassFile";
|
||||
|
Loading…
Reference in New Issue
Block a user