-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
22
-
None
Currently it is inconvenient to programmatically determine if a module is patched or not.
2 options are to either list all the module resources, and see if they are located in a common root path, or to rely on the toString output of ModuleReferenceImpl.
However, ModuleReferenceImpl does have an `isPatched` predicate, which could be exposed through the ModuleReference interface. For a given module we could ten determine whether it is patched like so:
public static boolean isPatched(Module mod) {
return mod.getLayer()
.configuration().findModule(mod.getName()).orElseThrow() // ResolvedModule
.reference().isPatched();
}
2 options are to either list all the module resources, and see if they are located in a common root path, or to rely on the toString output of ModuleReferenceImpl.
However, ModuleReferenceImpl does have an `isPatched` predicate, which could be exposed through the ModuleReference interface. For a given module we could ten determine whether it is patched like so:
public static boolean isPatched(Module mod) {
return mod.getLayer()
.configuration().findModule(mod.getName()).orElseThrow() // ResolvedModule
.reference().isPatched();
}