SYSTEM Cited by 1 source
javac plugin (Java Compiler Plugin)¶
A javac plugin is a Java-compiler extension mechanism that
runs during compilation and can inspect, analyse, or transform
the compilation unit. Distinct from a compiler plugin in
other languages by virtue of running inside javac; distinct
from an annotation processor by operating on
already-attributed trees (post-attribution hooks).
Role in the wiki¶
Meta built a javac plugin to collect runtime nullability telemetry across Java/Kotlin interop:
"We decided to borrow an idea from the Kotlin compiler and create a Java compiler plugin that helps us collect runtime nullability data. This plugin allows us to collect data on all return types and parameters that are receiving/returning a null value and are not annotated as such."
Canonical wiki instance of
concepts/runtime-nullability-telemetry. The collected data
drives codemods that backfill @Nullable annotations into the
Java code, improving accuracy for both eventual translation
and Java code that Meta "may never translate."
The architectural choice is notable: when static analysis runs out of road, Meta instruments production rather than continuing to refine the analyser.
Seen in¶
- sources/2024-12-18-meta-translating-10m-lines-of-java-to-kotlin — the runtime-nullability-plugin instance.
Related¶
- systems/nullsafe — the static-analysis tool the javac plugin complements.
- systems/kotlinator — the consumer of the annotation backfill.
- concepts/runtime-nullability-telemetry — the concept this plugin instantiates.
- concepts/interlanguage-null-safety — the problem space.