Skip to content

Commit

Permalink
Fix javadoc errors, remove unused classes
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytv committed Jan 26, 2024
1 parent fe53b0e commit 1ed50da
Show file tree
Hide file tree
Showing 19 changed files with 191 additions and 1,287 deletions.
12 changes: 6 additions & 6 deletions patches/server/0007-ConcurrentUtil.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3596,7 +3596,7 @@ index 0000000000000000000000000000000000000000..b71404be2c82f7db35272b367af861e9
+}
diff --git a/src/main/java/ca/spottedleaf/concurrentutil/map/SWMRHashTable.java b/src/main/java/ca/spottedleaf/concurrentutil/map/SWMRHashTable.java
new file mode 100644
index 0000000000000000000000000000000000000000..a037bb57bedc0cde6b979f5c1f9669678fa7bd16
index 0000000000000000000000000000000000000000..4289b984badd6f9167c86193454a630b9a40f9f5
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/concurrentutil/map/SWMRHashTable.java
@@ -0,0 +1,1673 @@
Expand Down Expand Up @@ -3724,7 +3724,7 @@ index 0000000000000000000000000000000000000000..a037bb57bedc0cde6b979f5c1f966967
+ /**
+ * Constructs this map with the specified capacity and load factor.
+ * @param capacity specified capacity, > 0
+ * @param loadFactor specified load factor, > 0 && finite
+ * @param loadFactor specified load factor, > 0 and finite
+ */
+ public SWMRHashTable(final int capacity, final float loadFactor) {
+ final int tableSize = getCapacityFor(capacity);
Expand Down Expand Up @@ -3772,7 +3772,7 @@ index 0000000000000000000000000000000000000000..a037bb57bedc0cde6b979f5c1f966967
+ * with the specified load factor.
+ * All of the specified map's entries are copied into this map.
+ * @param capacity specified capacity, > 0
+ * @param loadFactor specified load factor, > 0 && finite
+ * @param loadFactor specified load factor, > 0 and finite
+ * @param other The specified map.
+ */
+ public SWMRHashTable(final int capacity, final float loadFactor, final Map<K, V> other) {
Expand Down Expand Up @@ -5275,7 +5275,7 @@ index 0000000000000000000000000000000000000000..a037bb57bedc0cde6b979f5c1f966967
+}
diff --git a/src/main/java/ca/spottedleaf/concurrentutil/map/SWMRLong2ObjectHashTable.java b/src/main/java/ca/spottedleaf/concurrentutil/map/SWMRLong2ObjectHashTable.java
new file mode 100644
index 0000000000000000000000000000000000000000..1e98f778ffa0a7bb00ebccaaa8bde075183e41f0
index 0000000000000000000000000000000000000000..94fca3c9b31ca4e40688209e419e93320b0f7c34
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/concurrentutil/map/SWMRLong2ObjectHashTable.java
@@ -0,0 +1,672 @@
Expand Down Expand Up @@ -5370,7 +5370,7 @@ index 0000000000000000000000000000000000000000..1e98f778ffa0a7bb00ebccaaa8bde075
+ /**
+ * Constructs this map with the specified capacity and load factor.
+ * @param capacity specified capacity, > 0
+ * @param loadFactor specified load factor, > 0 && finite
+ * @param loadFactor specified load factor, > 0 and finite
+ */
+ public SWMRLong2ObjectHashTable(final int capacity, final float loadFactor) {
+ final int tableSize = getCapacityFor(capacity);
Expand Down Expand Up @@ -5418,7 +5418,7 @@ index 0000000000000000000000000000000000000000..1e98f778ffa0a7bb00ebccaaa8bde075
+ * with the specified load factor.
+ * All of the specified map's entries are copied into this map.
+ * @param capacity specified capacity, > 0
+ * @param loadFactor specified load factor, > 0 && finite
+ * @param loadFactor specified load factor, > 0 and finite
+ * @param other The specified map.
+ */
+ public SWMRLong2ObjectHashTable(final int capacity, final float loadFactor, final SWMRLong2ObjectHashTable<V> other) {
Expand Down
24 changes: 22 additions & 2 deletions patches/server/0008-CB-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ index 809fdf2da78293391aa5c60c04f4ad652b152eec..955b0abd4019fc45df84719eee6bf413
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b5256eefb64808ae15bd622a8eccbe13454b4564..82d5c749a70f7a808c073263e861e09913c529d4 100644
index 5f12fce84e0ec001dc43523753883a098434fcb6..d6a1b9bbf9737ed884ecf4af31e1521f46807405 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2454,7 +2454,13 @@ public final class CraftServer implements Server {
Expand All @@ -103,7 +103,7 @@ index b5256eefb64808ae15bd622a8eccbe13454b4564..82d5c749a70f7a808c073263e861e099

@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 686d6376322dab126393198da87e02827ec0fda2..5edad60f75a14b63ad704a68a3920f180ae82c40 100644
index c8f0570b7d37a0c0bddb0a65c36fb32de584df8f..02060584892d630d91f58e864ed34656ee738572 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -122,6 +122,7 @@ public class Main {
Expand All @@ -114,6 +114,26 @@ index 686d6376322dab126393198da87e02827ec0fda2..5edad60f75a14b63ad704a68a3920f18
this.acceptsAll(Main.asList("nogui"), "Disables the graphical console");

this.acceptsAll(Main.asList("nojline"), "Disables jline and emulates the vanilla console");
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..c017ce2ca1bc535795c958a2e509af2adf88efa9 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -26,6 +26,7 @@ import org.bukkit.scheduler.BukkitWorker;

/**
* The fundamental concepts for this implementation:
+ * <ul>
* <li>Main thread owns {@link #head} and {@link #currentTick}, but it may be read from any thread</li>
* <li>Main thread exclusively controls {@link #temp} and {@link #pending}.
* They are never to be accessed outside of the main thread; alternatives exist to prevent locking.</li>
@@ -41,6 +42,7 @@ import org.bukkit.scheduler.BukkitWorker;
* <li>Sync tasks are only to be removed from runners on the main thread when coupled with a removal from pending and temp.</li>
* <li>Most of the design in this scheduler relies on queuing special tasks to perform any data changes on the main thread.
* When executed from inside a synchronous method, the scheduler will be updated before next execution by virtue of the frequent {@link #parsePending()} calls.</li>
+ * </ul>
*/
public class CraftScheduler implements BukkitScheduler {

diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
index 5ac25dab93fd4c9e9533c80d1ca3d93446d7a365..245ad120a36b6defca7e6889faae1ca5fc33d0c7 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java
Expand Down
17 changes: 8 additions & 9 deletions patches/server/0009-MC-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ index 0000000000000000000000000000000000000000..a743703502cea333bd4231b6557de50e
+}
diff --git a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
new file mode 100644
index 0000000000000000000000000000000000000000..653cbd10c7280f3aeeaaff712d083dde461da092
index 0000000000000000000000000000000000000000..8066e27ff88454cb4bc8075d936e58a067dbe9b4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java
@@ -0,0 +1,71 @@
Expand All @@ -2098,7 +2098,7 @@ index 0000000000000000000000000000000000000000..653cbd10c7280f3aeeaaff712d083dde
+import java.util.Collection;
+
+/**
+ * @author Spottedleaf <Spottedleaf@users.noreply.github.com>
+ * @author Spottedleaf &lt;Spottedleaf@users.noreply.github.com>
+ */
+public final class OptimizedSmallEnumSet<E extends Enum<E>> {
+
Expand Down Expand Up @@ -3482,10 +3482,10 @@ index 0000000000000000000000000000000000000000..cea9c098ade00ee87b8efc8164ab72f5
+}
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..6d60bb9f77198de3f0692c24b3b0ae085f3a80d0
index 0000000000000000000000000000000000000000..7ae65f05eb2219a63a108728e4137b245775d08b
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -0,0 +1,533 @@
@@ -0,0 +1,532 @@
+package io.papermc.paper.util;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
Expand Down Expand Up @@ -3800,7 +3800,6 @@ index 0000000000000000000000000000000000000000..6d60bb9f77198de3f0692c24b3b0ae08
+ * Ensures the target code is running on the main thread
+ * @param reason
+ * @param run
+ * @return
+ */
+ public static void ensureMain(String reason, Runnable run) {
+ if (!isMainThread()) {
Expand Down Expand Up @@ -7934,18 +7933,18 @@ index bf46aa3bd46ffabe92d58aa45ea0dfe6c98d94aa..23b83f8e98d681895b4e23cda4f3d50f
if (original instanceof CraftItemStack) {
CraftItemStack stack = (CraftItemStack) original;
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..2b80ddb42c8e5fd32b37f89e894353167c8a698e 100644
index c017ce2ca1bc535795c958a2e509af2adf88efa9..0f7c3a44acf3c59ae43605e573f9da7f7c594647 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -44,6 +44,7 @@ import org.bukkit.scheduler.BukkitWorker;
@@ -46,6 +46,7 @@ import org.bukkit.scheduler.BukkitWorker;
*/
public class CraftScheduler implements BukkitScheduler {

+ static Plugin MINECRAFT = new MinecraftInternalPlugin();
/**
* The start ID for the counter.
*/
@@ -192,6 +193,11 @@ public class CraftScheduler implements BukkitScheduler {
@@ -194,6 +195,11 @@ public class CraftScheduler implements BukkitScheduler {
this.runTaskTimer(plugin, (Object) task, delay, period);
}

Expand All @@ -7957,7 +7956,7 @@ index 905adf97c0d1f0d1c774a6835a5dffcfea884e58..2b80ddb42c8e5fd32b37f89e89435316
public BukkitTask runTaskTimer(Plugin plugin, Object runnable, long delay, long period) {
CraftScheduler.validate(plugin, runnable);
if (delay < 0L) {
@@ -415,13 +421,20 @@ public class CraftScheduler implements BukkitScheduler {
@@ -417,13 +423,20 @@ public class CraftScheduler implements BukkitScheduler {
task.run();
task.timings.stopTiming(); // Spigot
} catch (final Throwable throwable) {
Expand Down
16 changes: 8 additions & 8 deletions patches/server/0014-Timings-v2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ index f53e223e2412846b82298233459ec9953bc0a63e..87e7071a381540be3b1db55f5d606e9e

public Player.Spigot spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf03a0a6a66 100644
index 0f7c3a44acf3c59ae43605e573f9da7f7c594647..a3ccc2da0927cc49e5fcfbd863e648ad0f25cc0d 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -1,5 +1,6 @@
Expand All @@ -1848,7 +1848,7 @@ index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf0
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.util.ArrayList;
@@ -194,7 +195,8 @@ public class CraftScheduler implements BukkitScheduler {
@@ -196,7 +197,8 @@ public class CraftScheduler implements BukkitScheduler {
}

public BukkitTask scheduleInternalTask(Runnable run, int delay, String taskName) {
Expand All @@ -1858,7 +1858,7 @@ index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf0
return handle(task, delay);
}

@@ -275,7 +277,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -277,7 +279,7 @@ public class CraftScheduler implements BukkitScheduler {
}
return false;
}
Expand All @@ -1867,7 +1867,7 @@ index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf0
this.handle(task, 0L);
for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
if (taskPending == task) {
@@ -310,7 +312,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -312,7 +314,7 @@ public class CraftScheduler implements BukkitScheduler {
}
}
}
Expand All @@ -1876,7 +1876,7 @@ index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf0
this.handle(task, 0L);
for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
if (taskPending == task) {
@@ -417,9 +419,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -419,9 +421,7 @@ public class CraftScheduler implements BukkitScheduler {
if (task.isSync()) {
this.currentTask = task;
try {
Expand All @@ -1886,7 +1886,7 @@ index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf0
} catch (final Throwable throwable) {
// Paper start
String msg = String.format(
@@ -453,8 +453,10 @@ public class CraftScheduler implements BukkitScheduler {
@@ -455,8 +455,10 @@ public class CraftScheduler implements BukkitScheduler {
this.runners.remove(task.getTaskId());
}
}
Expand All @@ -1897,15 +1897,15 @@ index 2b80ddb42c8e5fd32b37f89e894353167c8a698e..bd1057681d0c7470c497b873ff18abf0
this.debugHead = this.debugHead.getNextHead(currentTick);
}

@@ -491,6 +493,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -493,6 +495,7 @@ public class CraftScheduler implements BukkitScheduler {
}

private void parsePending() {
+ MinecraftTimings.bukkitSchedulerPendingTimer.startTiming();
CraftTask head = this.head;
CraftTask task = head.getNext();
CraftTask lastTask = head;
@@ -509,6 +512,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -511,6 +514,7 @@ public class CraftScheduler implements BukkitScheduler {
task.setNext(null);
}
this.head = lastTask;
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0060-Add-exception-reporting-event.patch
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ index d9daf07132c46548964a75588b69d7a74680e917..66994aa135037919219e0bbcabe7de9f
try {
filechannel.close();
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index bd1057681d0c7470c497b873ff18abf03a0a6a66..f39c836970572fe2e29e794a6af35332af8f7424 100644
index a3ccc2da0927cc49e5fcfbd863e648ad0f25cc0d..dc7872afbdd06eb976bee6aee56a40b44084c24a 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -434,6 +434,8 @@ public class CraftScheduler implements BukkitScheduler {
@@ -436,6 +436,8 @@ public class CraftScheduler implements BukkitScheduler {
msg,
throwable);
}
Expand All @@ -204,7 +204,7 @@ index bd1057681d0c7470c497b873ff18abf03a0a6a66..f39c836970572fe2e29e794a6af35332
// Paper end
} finally {
this.currentTask = null;
@@ -441,7 +443,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -443,7 +445,7 @@ public class CraftScheduler implements BukkitScheduler {
this.parsePending();
} else {
this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ One report of a suspected memory leak with the system.
This adds additional overhead to asynchronous task dispatching

diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index f39c836970572fe2e29e794a6af35332af8f7424..b1e61ce608eeacdbb70849c1e3e39daf37b3f2a2 100644
index dc7872afbdd06eb976bee6aee56a40b44084c24a..af3997e47aff9c43dc5019f1b0267effe1df5205 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -442,7 +442,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -444,7 +444,7 @@ public class CraftScheduler implements BukkitScheduler {
}
this.parsePending();
} else {
Expand All @@ -21,7 +21,7 @@ index f39c836970572fe2e29e794a6af35332af8f7424..b1e61ce608eeacdbb70849c1e3e39daf
this.executor.execute(new com.destroystokyo.paper.ServerSchedulerReportingWrapper(task)); // Paper
// We don't need to parse pending
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
@@ -459,7 +459,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -461,7 +461,7 @@ public class CraftScheduler implements BukkitScheduler {
this.pending.addAll(temp);
temp.clear();
MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper
Expand All @@ -30,7 +30,7 @@ index f39c836970572fe2e29e794a6af35332af8f7424..b1e61ce608eeacdbb70849c1e3e39daf
}

private void addTask(final CraftTask task) {
@@ -523,10 +523,15 @@ public class CraftScheduler implements BukkitScheduler {
@@ -525,10 +525,15 @@ public class CraftScheduler implements BukkitScheduler {

@Override
public String toString() {
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0135-Basic-PlayerProfile-API.patch
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ index 0000000000000000000000000000000000000000..7ac27392a8647ef7d0dc78efe78703e9
+ @NotNull GameProfile buildGameProfile();
+}
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index 6d60bb9f77198de3f0692c24b3b0ae085f3a80d0..e5a7a77fda0c7e81c8535ef8cfaca2222b0d79fb 100644
index 7ae65f05eb2219a63a108728e4137b245775d08b..b08190d604f7f95f771a4da115cc50c38c5f1691 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -1,5 +1,7 @@
Expand All @@ -565,7 +565,7 @@ index 6d60bb9f77198de3f0692c24b3b0ae085f3a80d0..e5a7a77fda0c7e81c8535ef8cfaca222
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.CraftWorld;
@@ -361,6 +364,10 @@ public final class MCUtil {
@@ -360,6 +363,10 @@ public final class MCUtil {
return run.get();
}

Expand Down Expand Up @@ -612,7 +612,7 @@ index adb472c175cc6f6ced7075a37423d6c898fd5ccb..1ec0f3a7148c2f412421772f6e1dff0b
String s1 = name.toLowerCase(Locale.ROOT);
GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 883c053baea5968a978f1619ebb170647fe15eef..22f5ff1e6f03fc46eb05eaf95ca6f8e2bac1f894 100644
index e7ad8c2d40568a243b6d3b2a28065083802afe5d..5c9415a5771191b7e3fec02f5a9ad569e735c4aa 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -260,6 +260,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException;
Expand Down
Loading

0 comments on commit 1ed50da

Please sign in to comment.