Class JarTreeShaker

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

class JarTreeShaker extends Object
  • Constructor Details

  • Method Details

    • run

      Runs the tree-shake analysis: traces reachable classes from roots via BFS, evaluates conditional roots to a fixed point, computes removal stats, and returns a JarTreeShakeBuildItem with the reachable set and per-dependency removals.
    • extractStringClassReferences

      static Set<String> extractStringClassReferences(byte[] bytecode, Set<String> knownClasses)
      Extracts LDC string constants from bytecode that match known class names. This catches class names passed as string arguments to methods that eventually call Class.forName() at runtime (e.g. Quarkus recorder generated code). Also handles delimited class name lists (comma, colon) used by frameworks like RESTEasy for provider and resource builder lists.
    • matchClassNames

      static void matchClassNames(String str, Set<String> knownClasses, Set<String> refs)
      Checks whether a string (or its comma/colon-delimited parts) matches known class names, adding matches to refs. Uses manual character-level splitting to avoid the per-call Pattern compilation that String.split(java.lang.String, int) incurs for the [,:] character class.