Skip to main content

extract_lambda_targets

Function extract_lambda_targets 

Source
pub fn extract_lambda_targets(class: &ClassFile<'_>) -> Vec<LambdaTargetStub>
Expand description

Extract lambda/method-reference targets from a parsed class file.

Iterates class-level attributes, finds the BootstrapMethods attribute, and filters entries whose bootstrap method handle points to LambdaMetafactory.metafactory or altMetafactory. For each matching entry, the third bootstrap argument (a MethodHandle) is converted to a LambdaTargetStub.

ยงReturns

A Vec of targets, potentially empty if no BootstrapMethods attribute exists or none of the entries are LambdaMetafactory invocations.

Non-LambdaMetafactory bootstrap entries are silently skipped. Malformed entries (e.g., fewer than 3 arguments, wrong argument type at index 2) are logged as warnings and skipped.