JVM should validate a module by checking for an instance of java.lang.reflect.Module

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: hotspot
    • b131

      In Modules::define_module(), the JVM is checking if the module handle being passed is a subclass of java.lang.reflect.Module. java.lang.reflect.Module is a final class and can not be subclassed. It instead should check if the module handle is a class of java.lang.reflect.module.

        Handle module_handle(THREAD, JNIHandles::resolve(module));
        if (!java_lang_reflect_Module::is_subclass(module_handle->klass())) {
          THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
                    "module is not a subclass of java.lang.reflect.Module");
        }

            Assignee:
            Lois Foltan
            Reporter:
            Lois Foltan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: