Skip to main content

Module platform

Module platform 

Source
Expand description

Platform symbols: render IntDef/LongDef magic numbers as their constant names (view.setVisibility(8) → android.view.View.GONE).

Two inputs, both from an Android SDK platform directory:

  • android.jar — classfile ConstantValue attributes give every static final field’s value (android.view.View.GONE = 8).
  • data/annotations.zip — per-method-parameter @IntDef/@LongDef domains as annotations.xml items (the SDK’s metalava metadata — the jar itself does not retain them).

A call site rewrites only on an EXACT domain match: flag domains (combinable values such as Intent flags) stay numeric for combined literals and render named for single values.

Structs§

PlatformSymbols

Functions§

classfile_constants
installed
Whether a symbol table is available (explicit or built-in).
named_constant
The named constant for a call argument, when the platform knows the parameter’s domain and the literal matches exactly one member. Rendered dotted-and-qualified (the output has no imports).
set_symbols
Install the symbol table for this run (the driver installs the built-in default or an explicit --symbols build, before workers start — same pattern as the case-rename registry).

Type Aliases§

ClassConstants
Read every static-final field’s constant value out of one classfile. Only the pieces a constant lookup needs survive: the constant pool (Utf8/Class/Integer/Long/String entries), field_info with its ConstantValue attribute, and method descriptors for domain keys. (owner, field) → value; (owner, method, descriptor) list.