Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8311667

Add predicate to check if a module is patched

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 22
    • 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();
          }

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

              Created:
              Updated:
              Resolved: