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

SA ClassWriter.java fails to skip overpass methods

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • hotspot
    • None
    • b20

      The following code in sun/jvm/hotspot/tools/jcore/ClassWriter.java tries to skip the overpass methods

      https://github.com/openjdk/jdk/blob/a8871f5d26e5cb42c031c7b736ec30b1b147a2bc/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java#L436-L446

             for (int i = 0; i < methods.length(); i++) {
                  Method m = methods.at(i);
                  long accessFlags = m.getAccessFlags();
                  // overpass method
                  if (accessFlags == (JVM_ACC_PUBLIC | JVM_ACC_SYNTHETIC | JVM_ACC_BRIDGE)) {
                      continue;
                  }

      However, accessFlags may contain bits that are internal to the JVM. They should be masked off using:

      long accessFlags = m.getAccessFlags() & JVM_RECOGNIZED_METHOD_MODIFIERS;

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

              Created:
              Updated:
              Resolved: