Package io.quarkus.deployment.pkg.steps
Class JarTreeShaker
java.lang.Object
io.quarkus.deployment.pkg.steps.JarTreeShaker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractStringClassReferences(byte[] bytecode, Set<String> knownClasses) Extracts LDC string constants from bytecode that match known class names.(package private) static voidChecks whether a string (or its comma/colon-delimited parts) matches known class names, adding matches torefs.(package private) JarTreeShakeBuildItemrun()Runs the tree-shake analysis: traces reachable classes from roots via BFS, evaluates conditional roots to a fixed point, computes removal stats, and returns aJarTreeShakeBuildItemwith the reachable set and per-dependency removals.
-
Constructor Details
-
JarTreeShaker
JarTreeShaker(JarTreeShakeInput input)
-
-
Method Details
-
run
JarTreeShakeBuildItem 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 aJarTreeShakeBuildItemwith the reachable set and per-dependency removals. -
extractStringClassReferences
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
Checks whether a string (or its comma/colon-delimited parts) matches known class names, adding matches torefs. Uses manual character-level splitting to avoid the per-callPatterncompilation thatString.split(java.lang.String, int)incurs for the[,:]character class.
-