classloaders: Java class loaders module (three built-in loaders and which modules each owns, parent delegation traced across a two-loader chain, child-first PluginLoader, class identity and the failing (Plugin) cast, Class.forName vs loadClass initialisation, ClassNotFoundException vs NoClassDefFoundError incl. 'Could not initialize class', hot reload, unloading and a Registry leak, context class loader, jcmd VM.classloaders), 18 contract tests

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b5pUjAyJuUaNEQqzGJ
This commit is contained in:
Ankur
2026-11-25 13:17:24 +05:30
co-authored by Claude Sonnet 5.5
parent 74da9cd899
commit cca173d104
37 changed files with 1151 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
== child.loadClass("com.acme.UsesLib") ==
[child] loadClass(com.acme.UsesLib)
[shared] loadClass(com.acme.UsesLib)
[shared] findClass(com.acme.UsesLib) -> not in my directory
[child] findClass(com.acme.UsesLib) -> defineClass
defined by: 'child' (com.ankurm.classloaders.DirLoader)
== Running it: UsesLib needs Lib, which triggers a second load ==
[child] loadClass(com.acme.shared.Lib)
[shared] loadClass(com.acme.shared.Lib)
[shared] findClass(com.acme.shared.Lib) -> defineClass
result: UsesLib called Lib
== Where did Lib end up? ==
[child] loadClass(com.acme.shared.Lib)
Lib defined by: 'shared' (com.ankurm.classloaders.DirLoader) (the parent, not the loader that was asked)
== A JDK class never reaches the child's own directory ==
java.lang.String defined by: null (the bootstrap loader)