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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • 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");
        }

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

              Created:
              Updated:
              Resolved: