Interface ClassRewriteRule

All Known Implementing Classes:
InvokeKindAlignmentRule

interface ClassRewriteRule
An internal, ordered transformation of a module's class bytes. Implementations must be safe to invoke concurrently for different classes. No rule is installed by the foundation loader.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether this rule actually repairs a particular reference for the running server.
    byte[]
    rewrite(String binaryName, byte[] bytes)
    Returns the replacement bytes; never mutates the input and never returns null.
    boolean
    wouldChange(String binaryName, byte[] bytes)
    Inspects the current bytes without changing them or initializing any module class.
  • Method Details

    • wouldChange

      boolean wouldChange(String binaryName, byte[] bytes) throws Exception
      Inspects the current bytes without changing them or initializing any module class.
      Throws:
      Exception
    • rewrite

      byte[] rewrite(String binaryName, byte[] bytes) throws Exception
      Returns the replacement bytes; never mutates the input and never returns null.
      Throws:
      Exception
    • covers

      boolean covers(ServerApiReference reference)
      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.