SnippetLoader

private class SnippetLoader(masking: MaskingClassLoader, val game: ClassLoader, val redirectKotlin: Boolean) : ClassLoader

The whole snippet chain in ONE hop: game-identity names to the game loader, the rest to masking, and only a miss in both retries a hybrid server's plugins (PluginBridge). One loader, not one per concern: every snippet class load walks this, and each level costs a lock + findLoadedClass.

Plugins stay last (so MC/mods/org.bukkit.* keep the server's identity, not a shaded copy) and out of MaskingClassLoader.loadClass, whose compiler lookups miss by design.

Constructors

Link copied to clipboard
constructor(masking: MaskingClassLoader, game: ClassLoader, redirectKotlin: Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val classes: ArrayList<Class<*>?>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val game: ClassLoader
Link copied to clipboard
private val libraries: NativeLibraries?
Link copied to clipboard
open val name: String?
Link copied to clipboard
private val nameAndId: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
protected open val packages: Array<out Package?>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val redirectKotlin: Boolean
Link copied to clipboard

Functions

Link copied to clipboard
open fun addClass(c: Class<*>?)
Link copied to clipboard
private open fun checkCerts(name: String?, cs: CodeSource?)
Link copied to clipboard
Link copied to clipboard
private open fun compareCerts(pcerts: Array<out Certificate?>?, certs: Array<out Certificate?>?): Boolean
Link copied to clipboard
protected fun defineClass(b: ByteArray?, off: Int, len: Int): Class<*>?
protected fun defineClass(name: String?, b: ByteBuffer?, protectionDomain: ProtectionDomain?): Class<*>?
protected fun defineClass(name: String?, b: ByteArray?, off: Int, len: Int): Class<*>?
protected fun defineClass(name: String?, b: ByteArray?, off: Int, len: Int, protectionDomain: ProtectionDomain?): Class<*>?
Link copied to clipboard
Link copied to clipboard
open fun definePackage(c: Class<*>?): Package?
open fun definePackage(name: String?, m: Module?): Package?
protected open fun definePackage(name: String?, specTitle: String?, specVersion: String?, specVendor: String?, implTitle: String?, implVersion: String?, implVendor: String?, sealBase: URL?): Package?
Link copied to clipboard
open fun desiredAssertionStatus(className: String?): Boolean
Link copied to clipboard
protected open fun findClass(name: String?): Class<*>?
protected open fun findClass(moduleName: String?, name: String?): Class<*>?
Link copied to clipboard
protected open fun findLibrary(libname: String?): String?
Link copied to clipboard
protected fun findLoadedClass(name: String?): Class<*>?
Link copied to clipboard
private external fun findLoadedClass0(p0: String?): Class<*>?
Link copied to clipboard
protected open fun findResource(name: String?): URL?
protected open fun findResource(moduleName: String?, name: String?): URL?
Link copied to clipboard
protected open fun findResources(name: String?): Enumeration<URL?>?
Link copied to clipboard
protected fun findSystemClass(name: String?): Class<*>?
Link copied to clipboard
private fun gameClass(name: String): Class<*>?

The game's copy of name, or null: game lacks it (no ASM on plain Bukkit, a kotlin class the mods don't ship), or its loader is closed — use ours.

Link copied to clipboard
private fun gameIdentity(n: String): Boolean

Names that must be the GAME's copy, or a snippet value is a different class at the seam → LinkageError. ASM always (snippets hand ClassNode to Mixin); masking keeps its own newest copy, since ScriptWeave reads bytecode emitted at the running JDK — past some loaders' ASM. Kotlin only in SPLIT; SHARE_ALL already settled it (Regime).

Link copied to clipboard
protected open fun getClassLoadingLock(className: String?): Any?
Link copied to clipboard
Link copied to clipboard
private open fun getNamedPackage(pn: String?, m: Module?): NamedPackage?
Link copied to clipboard
protected open fun getPackage(name: String?): Package?
Link copied to clipboard
open fun getResource(name: String?): URL?
Link copied to clipboard
private open fun getResourceAsByteArray(name: String?): ByteArray?
Link copied to clipboard
Link copied to clipboard
open fun getResources(name: String?): Enumeration<URL?>?
Link copied to clipboard
private open fun initializeJavaAssertionMaps()
Link copied to clipboard
fun load(name: String): Class<*>

Two shapes mean "not mine": the ordinary ClassNotFoundException, and a CLOSED loader — Bukkit closes a plugin's the moment its onDisable returns, and Paper's then report the shut jar from findClass as an IllegalStateException, which nothing downstream catches (not its own libraryLoader fallback either). Catching it is what still reaches PluginBridge past a disabled plugin — OURS included, after an unsupported /reload; a name only that loader could define still fails, now with the zip error as cause.

Link copied to clipboard
open fun loadClass(name: String?): Class<*>?
fun loadClass(module: Module?, name: String?): Class<*>?
protected open override fun loadClass(name: String, resolve: Boolean): Class<*>
Link copied to clipboard
fun name(): String?
Link copied to clipboard
open fun nameAndId(): String?
Link copied to clipboard
open fun packages(): Stream<Package?>?
Link copied to clipboard
private fun pluginClass(name: String, notInHost: Exception): Class<*>
Link copied to clipboard
private open fun postDefineClass(c: Class<*>?, pd: ProtectionDomain?)
Link copied to clipboard
private open fun preDefineClass(name: String?, pd: ProtectionDomain?): ProtectionDomain?
Link copied to clipboard
private open fun reinitObjectField(name: String?, obj: Any?)
Link copied to clipboard
private open fun resetArchivedStates()
Link copied to clipboard
protected fun resolveClass(c: Class<*>?)
Link copied to clipboard
open fun resources(name: String?): Stream<URL?>?
Link copied to clipboard
open fun setClassAssertionStatus(className: String?, enabled: Boolean)
Link copied to clipboard
Link copied to clipboard
open fun setPackageAssertionStatus(packageName: String?, enabled: Boolean)
Link copied to clipboard
protected fun setSigners(c: Class<*>?, signers: Array<out Any?>?)
Link copied to clipboard
private open fun toPackage(name: String?, p: NamedPackage?, m: Module?): Package?
Link copied to clipboard
private open fun trySetObjectField(name: String?, obj: Any?): Boolean