Add predicate to check if a module is patched

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 22
    • Component/s: core-libs
    • 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();
          }

            Assignee:
            Unassigned
            Reporter:
            Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: