Add @Nullable to generated Thrift getters of optional fields

Proprietary

Annotates the generated-Java getter of a Thrift optional field with the JSpecify @Nullable annotation, reading the field's requiredness from the .thrift IDL (which appears as a plain-text source). In an Apache-Thrift-generated struct only an optional field may be left unset, so only its getter (getFoo(), or isFoo() for a bool) can return null; a required field, the Airbnb non_null extension, and an unqualified default field are populated and left untouched. A scanning pass parses each .thrift for struct/union/exception blocks and their optional fields; the edit pass annotates the matching getter on the generated Java class whose simple name equals the struct name and which implements org.apache.thrift.TBase. Adding @Nullable only states the contract the IDL already declares, so behavior is unchanged. Conservative by design: a getter is annotated only when its owning class is a recognized Thrift struct, its name matches an optional field, and it is not already nullable. Gated off the NullSafety apex (generated source); only Java sources are modified, and re-running after regeneration converges.

io.moderne.nullability.AnnotateThriftGetterNullability
mod run . --recipe=io.moderne.nullability.AnnotateThriftGetterNullability

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.