Class InvokeKindAlignmentRule

java.lang.Object
com.ultikits.ultitools.InvokeKindAlignmentRule
All Implemented Interfaces:
ClassRewriteRule

final class InvokeKindAlignmentRule extends Object implements ClassRewriteRule
Aligns server-owned method references with the real owner's class/interface kind.
  • Field Details

  • Constructor Details

    • InvokeKindAlignmentRule

      InvokeKindAlignmentRule(ServerApiProbe probe)
  • Method Details

    • wouldChange

      public boolean wouldChange(String binaryName, byte[] bytes)
      Description copied from interface: ClassRewriteRule
      Inspects the current bytes without changing them or initializing any module class.
      Specified by:
      wouldChange in interface ClassRewriteRule
    • rewrite

      public byte[] rewrite(String binaryName, byte[] bytes)
      Description copied from interface: ClassRewriteRule
      Returns the replacement bytes; never mutates the input and never returns null.
      Specified by:
      rewrite in interface ClassRewriteRule
    • covers

      public boolean covers(ServerApiReference reference)
      Description copied from interface: ClassRewriteRule
      Whether this rule actually repairs a particular reference for the running server. A rule must not claim to cover a missing member merely because it can align the owner's type kind.
      Specified by:
      covers in interface ClassRewriteRule
    • rewrittenSites

      int rewrittenSites(String binaryName)
      Read only after defineClass succeeds; a failed definition contributes no startup counts.
    • serverOwned

      private static boolean serverOwned(String owner)
    • mismatch

      private Boolean mismatch(String owner, boolean interfaceOwner)
      Null means either no known owner or no mismatch, never a guessed replacement.