Skip to content

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

Last updated · 319 distilled / 1,201 read