Drop added code comments

- Remove the Javadoc and inline comment blocks the three runtime-safety commits added under src/main
- Keep the GPL file header on the new spi type, matching every other file in that module
- Leave the superseded stale-temp ordering comment deleted rather than restoring text the new boot path contradicts
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-08 04:48:43 -04:00
1 parent 486c6eeae9
commit fd146de1ad
17 files changed
-140

No files matched your search

@@ -308,12 +308,6 @@ public class IrisSettings {
public boolean debug = false;
public boolean dumpMantleOnError = false;
public boolean disableNMS = false;
/**
* Attach the Java agent and install the server-code injection while Iris enables, instead of the
* first time a world Iris generates is about to load. Boot-time injection costs roughly a second
* on a server that may never load an Iris world; turn this on to pay it up front and have the
* startup safeguard verify it.
*/
public boolean eagerRuntimeInjection = false;
public boolean splashLogoStartup = true;
public boolean useConsoleCustomColors = true;
@@ -158,10 +158,6 @@ public class ServerConfigurator {
}
}
/**
* Forgets what the previous boot loaded, so an enable in the same JVM recompiles and revalidates rather
* than trusting a fingerprint taken against a server that is gone.
*/
public static void resetLoadedDatapackRuntime() {
synchronized (DATAPACK_INSTALL_LOCK) {
loadedDatapackRuntimeReady = false;
@@ -6,15 +6,6 @@ import art.arcane.iris.core.runtime.RuntimeInjection;
import art.arcane.iris.core.runtime.WorldRuntimeControlService;
import art.arcane.iris.spi.IrisServices;
/**
* Drops every process-wide cache core keeps about the running server, so a disable leaves nothing an
* enable in the same JVM could answer from.
* <p>
* The capability singletons are the reason this exists: each holds reflective handles onto the live
* CraftServer and MinecraftServer, and a boot that reused them would be talking to the previous server's
* objects. The platform binding itself is not cleared here - core still logs through it while the adapter
* finishes its own teardown - and is unbound last by the adapter.
*/
public final class IrisRuntimeStatics {
private IrisRuntimeStatics() {
}
@@ -52,9 +52,6 @@ public final class WorldLifecycleService {
this.worldBackendByKey = new ConcurrentHashMap<>();
}
/**
* Drops the cached snapshot so the next boot in this JVM builds one against the server it is running on.
*/
public static void reset() {
synchronized (WorldLifecycleService.class) {
instance = null;
@@ -6,15 +6,6 @@ import art.arcane.iris.core.nms.v1X.NMSBinding1X;
import art.arcane.iris.spi.IrisLogging;
import art.arcane.iris.util.project.agent.Agent;
/**
* Attaches the Java agent and installs the server-code injection Iris generation needs, once per boot.
* <p>
* Both steps are expensive - a self-attach to the running JVM, then three class retransformations - and
* neither is needed until a world that Iris generates is about to exist. A server that never loads an Iris
* world never pays for them. Whoever is about to produce such a world calls {@link #installIfDeferred()}
* first; it is idempotent, and a failure marks the runtime invalid so the same lock that guards a failed
* boot-time injection guards a failed deferred one.
*/
public final class RuntimeInjection {
private static final Object LOCK = new Object();
@@ -33,9 +24,6 @@ public final class RuntimeInjection {
public record Outcome(boolean installed, Failure failure, String lockReason) {
}
/**
* Runs the install if it has not run yet and reports what happened. Never throws.
*/
public static Outcome install() {
Outcome current = outcome;
if (current != null) {
@@ -52,10 +40,6 @@ public final class RuntimeInjection {
}
}
/**
* Installs on the deferred path and locks the runtime when that fails, so the caller's own readiness
* check refuses the world instead of loading it onto uninstrumented server code.
*/
public static void installIfDeferred() {
Outcome resolved = install();
if (resolved.installed()) {
@@ -71,9 +55,6 @@ public final class RuntimeInjection {
return current != null && current.installed();
}
/**
* Forgets the result so the next boot in this JVM installs against the binding it is running with.
*/
public static void reset() {
synchronized (LOCK) {
outcome = null;
@@ -76,9 +76,6 @@ public final class WorldRuntimeControlService {
+ ", " + backend.describeCapabilities();
}
/**
* Drops the cached snapshot so the next boot in this JVM builds one against the server it is running on.
*/
public static void reset() {
synchronized (WorldRuntimeControlService.class) {
instance = null;
@@ -74,8 +74,6 @@ public final class IrisSafeguard {
mode = currentMode;
count = issueCount;
// Danger is the lock. Recognising one check by its id and letting every other critical failure
// through was how a no-op NMS binding or a missing dimension type reached an open login queue.
if (currentMode == Mode.UNSTABLE) {
IrisStartupValidation.markRuntimeInvalid(lockReason == null ? GENERIC_LOCK_REASON : lockReason);
return;
@@ -96,10 +94,6 @@ public final class IrisSafeguard {
return attachment;
}
/**
* The per-check record for {@code /iris debugdump}. Without it a support report carried the server and
* plugin state but not one word about which startup check put the server in the mode it is in.
*/
public static String debugReport() {
StringBuilder builder = new StringBuilder();
builder.append("Startup safeguard: ").append(mode.getId())
@@ -2,13 +2,6 @@ package art.arcane.iris.core.safeguard;
import java.util.List;
/**
* The operator lines a boot prints when Iris enabled but its runtime is locked.
* <p>
* The Danger banner states the mode; this states the consequence. A locked runtime that still enabled is not
* covered by the vanilla-fallback refusal - that only runs when enable itself fails - so without this the
* only evidence is the first chunk request throwing hours later.
*/
public final class RuntimeLockNotice {
private RuntimeLockNotice() {
}
@@ -4,14 +4,6 @@ import art.arcane.iris.core.safeguard.Mode;
import java.util.List;
/**
* What one startup check found: the severity it reached, the console lines it wants printed, and - for a
* Danger result only - the reason the runtime is locked.
* <p>
* The lock reason is mandatory on {@link #danger(String, Diagnostic...)} because Danger is what stops player
* login, world creation and generation, and an operator has to be told which check did that and what fixes
* it. A check cannot reach Danger without answering that.
*/
public record CheckResult(Mode mode, String lockReason, List<Diagnostic> diagnostics) {
public CheckResult {
if (mode == null) {
@@ -4,14 +4,6 @@ import art.arcane.iris.core.safeguard.Mode;
import java.util.function.Supplier;
/**
* One startup check, plus the severity its own failure carries.
* <p>
* A check declares whether it is advisory or critical at the point it is written, so nothing downstream has
* to recognise a check by its id to decide what a failure means. An advisory check that throws is a Warning
* and leaves the runtime open; a critical one that throws is Danger and locks the runtime with the reason it
* carries here.
*/
public abstract class Task {
private final String id;
private final Mode failureMode;
@@ -37,9 +29,6 @@ public abstract class Task {
public abstract CheckResult run();
/**
* A check whose failure degrades Iris but leaves it usable.
*/
public static Task advisory(String id, Supplier<CheckResult> action) {
return new Task(id, Mode.WARNING, null) {
@Override
@@ -49,10 +38,6 @@ public abstract class Task {
};
}
/**
* A check whose failure means Iris cannot safely run. {@code throwLockReason} is what an operator is told
* when the check itself throws rather than returning a result.
*/
public static Task critical(String id, String throwLockReason, Supplier<CheckResult> action) {
return new Task(id, Mode.UNSTABLE, throwLockReason) {
@Override
@@ -229,10 +229,6 @@ public final class Tasks {
return Bukkit.getServer();
}
/**
* Matched against every registered plugin rather than asked for by exact name: a plugin.yml decides its
* own capitalization, and asking the plugin manager for "dynmap" misses a build that registers "Dynmap".
*/
private static Set<String> installedIncompatiblePlugins() {
Set<String> found = new LinkedHashSet<>();
Plugin[] plugins = server().getPluginManager().getPlugins();
@@ -117,11 +117,6 @@ public class StudioSVC implements IrisService {
private PackDownloadExecution activeDownload;
private boolean downloadAdmissionOpen;
/**
* Binds the stale cache/temp sweep a boot starts in the background. Pack imports stage through that
* folder, so a delete running underneath one truncates it; the import waits the sweep out instead of
* the boot waiting for the sweep.
*/
public static void gateDownloadsOnStaleTempCleanup(CompletableFuture<Void> cleanup) {
staleTempCleanup = cleanup == null ? CompletableFuture.completedFuture(null) : cleanup;
}
@@ -103,11 +103,6 @@ public final class BukkitPlatform implements IrisPlatform {
PLUGIN = plugin;
}
/**
* Drops every reference this class holds to the disabled plugin. Called last in the adapter's teardown,
* after core has stopped logging through the host bridge, so a disabled plugin instance is not reachable
* from a static for the life of the JVM.
*/
public static void releaseHost() {
PLUGIN = null;
HUD_BAR = null;