Class MethodKey

java.lang.Object
io.quarkus.deployment.pkg.steps.MethodKey

final class MethodKey extends Object
Structured key for a JVM method, storing the three components provided by ASM's MethodVisitor.visitMethodInsn(int, java.lang.String, java.lang.String, java.lang.String) and ClassVisitor.visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) without string concatenation.

The three strings (owner, name, descriptor) are interned by ASM's ClassReader from the class file constant pool, so storing them as references avoids all allocation. Hash code is lazily cached and computed from the three pre-cached String.hashCode() values.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final String
     
    (package private) final String
     
    (package private) final String
     
    (package private) static final Set<MethodKey>
    JDK methods that load classes by name — the seeds for call chain propagation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MethodKey(String owner, String name, String descriptor)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    (package private) boolean
    Returns true if this method is a constructor (<init>) or static initializer (<clinit>).
    (package private) static boolean
    Checks whether an internal class name (or method key starting with a class name) belongs to a JDK or infrastructure package that should be excluded from class-loading chain propagation.
    (package private) static boolean
    Returns true if the given method owner is one of the JDK classes that contain seed methods (ClassLoader, Class, or MethodHandles.Lookup).
    (package private) String
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • SEED_METHOD_KEYS

      static final Set<MethodKey> SEED_METHOD_KEYS
      JDK methods that load classes by name — the seeds for call chain propagation.
    • owner

      final String owner
    • name

      final String name
    • descriptor

      final String descriptor
  • Constructor Details

  • Method Details

    • ownerAsDotName

      String ownerAsDotName()
    • isInitOrClinit

      boolean isInitOrClinit()
      Returns true if this method is a constructor (<init>) or static initializer (<clinit>).
    • isSeedMethodOwner

      static boolean isSeedMethodOwner(String owner)
      Returns true if the given method owner is one of the JDK classes that contain seed methods (ClassLoader, Class, or MethodHandles.Lookup). Used during caller index construction to avoid creating MethodKey objects for JDK/infra calls that cannot possibly be seeds.
    • isJdkOrInfraClass

      static boolean isJdkOrInfraClass(String nameOrKey)
      Checks whether an internal class name (or method key starting with a class name) belongs to a JDK or infrastructure package that should be excluded from class-loading chain propagation. Works on both bare owner names (java/lang/Class) and full method keys (java/lang/Class.forName(...)) because the check is prefix-based.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object