From 389c72c62e771678e13a024b0aaec5795ad2a6a9 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 7 May 2019 18:13:52 +0100 Subject: [PATCH] Fix TimingsExport throwing an IAE due to legacy API usage --- Spigot-API-Patches/0004-Timings-v2.patch | 74 ++++++++++++------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Spigot-API-Patches/0004-Timings-v2.patch b/Spigot-API-Patches/0004-Timings-v2.patch index abb93ee633..e023612c2c 100644 --- a/Spigot-API-Patches/0004-Timings-v2.patch +++ b/Spigot-API-Patches/0004-Timings-v2.patch @@ -1,4 +1,4 @@ -From bc0ffd36b7da37fac29585df89bfd63f36d3391e Mon Sep 17 00:00:00 2001 +From 9932b11d3b8b9e6d252020d261cc20342b9343b2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 18:48:17 -0600 Subject: [PATCH] Timings v2 @@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2 diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java new file mode 100644 -index 00000000..64531fcc +index 000000000..64531fcce --- /dev/null +++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java @@ -0,0 +1,84 @@ @@ -96,7 +96,7 @@ index 00000000..64531fcc +} diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java new file mode 100644 -index 00000000..9b45ce88 +index 000000000..9b45ce887 --- /dev/null +++ b/src/main/java/co/aikar/timings/NullTimingHandler.java @@ -0,0 +1,68 @@ @@ -170,7 +170,7 @@ index 00000000..9b45ce88 +} diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java new file mode 100644 -index 00000000..933ecf9b +index 000000000..933ecf9bd --- /dev/null +++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java @@ -0,0 +1,83 @@ @@ -259,7 +259,7 @@ index 00000000..933ecf9b +} diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java new file mode 100644 -index 00000000..a21e5ead +index 000000000..a21e5ead5 --- /dev/null +++ b/src/main/java/co/aikar/timings/Timing.java @@ -0,0 +1,83 @@ @@ -348,7 +348,7 @@ index 00000000..a21e5ead +} diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java new file mode 100644 -index 00000000..a5d13a1e +index 000000000..a5d13a1e4 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingData.java @@ -0,0 +1,122 @@ @@ -476,7 +476,7 @@ index 00000000..a5d13a1e +} diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java new file mode 100644 -index 00000000..cc0390c0 +index 000000000..cc0390c06 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHandler.java @@ -0,0 +1,227 @@ @@ -709,7 +709,7 @@ index 00000000..cc0390c0 +} diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java new file mode 100644 -index 00000000..ddaed812 +index 000000000..ddaed8127 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistory.java @@ -0,0 +1,354 @@ @@ -1069,7 +1069,7 @@ index 00000000..ddaed812 +} diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java new file mode 100644 -index 00000000..86d5ac6b +index 000000000..86d5ac6bd --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java @@ -0,0 +1,58 @@ @@ -1133,7 +1133,7 @@ index 00000000..86d5ac6b +} diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java new file mode 100644 -index 00000000..df142a89 +index 000000000..df142a89b --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingIdentifier.java @@ -0,0 +1,116 @@ @@ -1255,7 +1255,7 @@ index 00000000..df142a89 +} diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java new file mode 100644 -index 00000000..0b34e0d0 +index 000000000..0b34e0d01 --- /dev/null +++ b/src/main/java/co/aikar/timings/Timings.java @@ -0,0 +1,293 @@ @@ -1554,7 +1554,7 @@ index 00000000..0b34e0d0 +} diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java new file mode 100644 -index 00000000..c0d8f201 +index 000000000..c0d8f2016 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsCommand.java @@ -0,0 +1,122 @@ @@ -1682,7 +1682,7 @@ index 00000000..c0d8f201 +} diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java new file mode 100644 -index 00000000..ea8734c4 +index 000000000..5923adfe6 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -0,0 +1,355 @@ @@ -1872,7 +1872,7 @@ index 00000000..ea8734c4 + pair("handlers", handlers), + pair("worlds", toObjectMapper(TimingHistory.worldMap.entrySet(), input -> pair(input.getValue(), input.getKey()))), + pair("tileentity", -+ toObjectMapper(tileEntityTypeSet, input -> pair(input.getId(), input.name()))), ++ toObjectMapper(tileEntityTypeSet, input -> pair(input.ordinal(), input.name()))), + pair("entity", + toObjectMapper(entityTypeSet, input -> pair(input.getTypeId(), input.name()))) + )); @@ -2043,7 +2043,7 @@ index 00000000..ea8734c4 +} diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java new file mode 100644 -index 00000000..ef824d70 +index 000000000..ef824d701 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsManager.java @@ -0,0 +1,188 @@ @@ -2237,7 +2237,7 @@ index 00000000..ef824d70 +} diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java new file mode 100644 -index 00000000..bf3e059f +index 000000000..bf3e059fe --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsReportListener.java @@ -0,0 +1,75 @@ @@ -2318,7 +2318,7 @@ index 00000000..bf3e059f +} diff --git a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java new file mode 100644 -index 00000000..632c4961 +index 000000000..632c49615 --- /dev/null +++ b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java @@ -0,0 +1,53 @@ @@ -2377,7 +2377,7 @@ index 00000000..632c4961 +} diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java new file mode 100644 -index 00000000..80155072 +index 000000000..80155072d --- /dev/null +++ b/src/main/java/co/aikar/util/Counter.java @@ -0,0 +1,38 @@ @@ -2421,7 +2421,7 @@ index 00000000..80155072 +} diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java new file mode 100644 -index 00000000..190bf059 +index 000000000..190bf0598 --- /dev/null +++ b/src/main/java/co/aikar/util/JSONUtil.java @@ -0,0 +1,140 @@ @@ -2567,7 +2567,7 @@ index 00000000..190bf059 +} diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java new file mode 100644 -index 00000000..63a899c7 +index 000000000..63a899c7d --- /dev/null +++ b/src/main/java/co/aikar/util/LoadingIntMap.java @@ -0,0 +1,76 @@ @@ -2649,7 +2649,7 @@ index 00000000..63a899c7 +} diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java new file mode 100644 -index 00000000..aedbb033 +index 000000000..aedbb0332 --- /dev/null +++ b/src/main/java/co/aikar/util/LoadingMap.java @@ -0,0 +1,368 @@ @@ -3023,7 +3023,7 @@ index 00000000..aedbb033 +} diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java new file mode 100644 -index 00000000..5989ee21 +index 000000000..5989ee212 --- /dev/null +++ b/src/main/java/co/aikar/util/MRUMapCache.java @@ -0,0 +1,111 @@ @@ -3139,7 +3139,7 @@ index 00000000..5989ee21 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 1c1f650d..8f46899f 100644 +index 1c1f650d8..8f46899fd 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -574,7 +574,6 @@ public final class Bukkit { @@ -3151,7 +3151,7 @@ index 1c1f650d..8f46899f 100644 /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 2a55a954..0f9e5ba7 100644 +index 2a55a9548..0f9e5ba72 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -1252,6 +1252,26 @@ public interface Server extends PluginMessageRecipient { @@ -3182,7 +3182,7 @@ index 2a55a954..0f9e5ba7 100644 * Sends the component to the player * diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 247d194f..72c5501e 100644 +index 247d194f8..72c5501e8 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -69,4 +69,12 @@ public interface UnsafeValues { @@ -3200,7 +3200,7 @@ index 247d194f..72c5501e 100644 } diff --git a/src/main/java/org/bukkit/command/BufferedCommandSender.java b/src/main/java/org/bukkit/command/BufferedCommandSender.java new file mode 100644 -index 00000000..f9a00aec +index 000000000..f9a00aecc --- /dev/null +++ b/src/main/java/org/bukkit/command/BufferedCommandSender.java @@ -0,0 +1,21 @@ @@ -3226,7 +3226,7 @@ index 00000000..f9a00aec + } +} diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index 4bfc2146..03bdc162 100644 +index 4bfc21468..03bdc1622 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -33,7 +33,8 @@ public abstract class Command { @@ -3256,7 +3256,7 @@ index 4bfc2146..03bdc162 100644 return true; } diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java -index d6c8938b..a6ad94ef 100644 +index d6c8938b1..a6ad94ef9 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java +++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java @@ -9,6 +9,7 @@ public class FormattedCommandAlias extends Command { @@ -3280,7 +3280,7 @@ index d6c8938b..a6ad94ef 100644 } diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java new file mode 100644 -index 00000000..ca1893e9 +index 000000000..ca1893e9f --- /dev/null +++ b/src/main/java/org/bukkit/command/MessageCommandSender.java @@ -0,0 +1,114 @@ @@ -3399,7 +3399,7 @@ index 00000000..ca1893e9 + +} diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index 81e4fa57..f020cb04 100644 +index 81e4fa573..f020cb04e 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -15,7 +15,6 @@ import org.bukkit.command.defaults.BukkitCommand; @@ -3456,7 +3456,7 @@ index 81e4fa57..f020cb04 100644 diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java deleted file mode 100644 -index 6023e4f6..00000000 +index 6023e4f61..000000000 --- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java +++ /dev/null @@ -1,253 +0,0 @@ @@ -3714,7 +3714,7 @@ index 6023e4f6..00000000 - // Spigot end -} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 06762a69..4f8ae7a8 100644 +index 06762a696..4f8ae7a83 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -1566,6 +1566,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -3730,7 +3730,7 @@ index 06762a69..4f8ae7a8 100644 @NotNull diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index f648c598..78a2d2f8 100644 +index f648c5989..78a2d2f8d 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -297,7 +297,6 @@ public final class SimplePluginManager implements PluginManager { @@ -3787,7 +3787,7 @@ index f648c598..78a2d2f8 100644 } } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 1173e433..82e379d1 100644 +index 1173e433a..82e379d16 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -53,7 +53,6 @@ public final class JavaPluginLoader implements PluginLoader { @@ -3830,7 +3830,7 @@ index 1173e433..82e379d1 100644 eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); } else { diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 0ffc1dfd..b859796b 100644 +index 0ffc1dfdb..b859796b4 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -24,7 +24,8 @@ import org.jetbrains.annotations.Nullable; @@ -3844,7 +3844,7 @@ index 0ffc1dfd..b859796b 100644 private final Map> classes = new ConcurrentHashMap>(); private final PluginDescriptionFile description; diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java -index 5ca863b3..612958a3 100644 +index 5ca863b36..612958a33 100644 --- a/src/main/java/org/bukkit/util/CachedServerIcon.java +++ b/src/main/java/org/bukkit/util/CachedServerIcon.java @@ -2,6 +2,7 @@ package org.bukkit.util; @@ -3867,7 +3867,7 @@ index 5ca863b3..612958a3 100644 + +} diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java -index 6a8f7f55..3cbe5c2b 100644 +index 6a8f7f551..3cbe5c2bb 100644 --- a/src/main/java/org/spigotmc/CustomTimingsHandler.java +++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java @@ -1,3 +1,26 @@