mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-20 23:21:24 +01:00
Comment to remember to fix extension dependency resolution in case we keep separate classloaders for extensions
This commit is contained in:
parent
66e85f166e
commit
35f7b27135
@ -32,6 +32,11 @@ public class ExtensionDependencyResolver implements DependencyResolver {
|
|||||||
if(extensionMap.containsKey(extensionName)) {
|
if(extensionMap.containsKey(extensionName)) {
|
||||||
DiscoveredExtension ext = extensionMap.get(extensionName);
|
DiscoveredExtension ext = extensionMap.get(extensionName);
|
||||||
// convert extension URLs to subdependencies
|
// convert extension URLs to subdependencies
|
||||||
|
// FIXME: this is not a deep conversion, this might create an issue in this scenario with different classloaders:
|
||||||
|
// A depends on an external lib (Ext<-A)
|
||||||
|
// B depends on A (A<-B)
|
||||||
|
// When loading B, with no deep conversion, Ext will not be added to the list of dependencies (because it is not a direct dependency)
|
||||||
|
// But when trying to call/access code from extension A, the parts dependent on Ext won't be inside B's dependencies, triggering a ClassNotFoundException
|
||||||
List<ResolvedDependency> deps = new LinkedList<>();
|
List<ResolvedDependency> deps = new LinkedList<>();
|
||||||
for(URL u : ext.files) {
|
for(URL u : ext.files) {
|
||||||
deps.add(new ResolvedDependency(u.toExternalForm(), u.toExternalForm(), "", u, new LinkedList<>()));
|
deps.add(new ResolvedDependency(u.toExternalForm(), u.toExternalForm(), "", u, new LinkedList<>()));
|
||||||
|
Loading…
Reference in New Issue
Block a user