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

Rename ModuleEntry::module() to module_oop()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 26
    • None
    • hotspot
    • master

      A module has both a Java and a C++ representation

          C++: ModuleEntry
          Java: java.lang.Module

      In C++, we have the following two methods

          ModuleEntry* InstanceKlass::module()
          oop ModuleEntry::module();

      This can lead to confusing code like this:

          InstanceKlass* ik = ...;
          oop module = ik->module()->module()

      Proposal:

      - Leave InstanceKlass::module() as is -- there's another function with the same style: "PackageEntry* InstanceKlass::package()"
      - Rename ModuleEntry::module() to ModuleEntry::module_oop(), so the above example can be more readable:

          InstanceKlass* ik = ...;
          oop module = ik->module()->module_oop()




            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: