Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add heuristic for obfuscated non-simple record getter
A simple getter is a getter which contains only "return <field>". The heuristic for detecting field getters can't detect anything more complex than that. This means that non-simple getters for record fields aren't detected, causing failure later on due to the assumption that a record component always has a getter. To fix that, add a simple heuristic to detect getters for record components, by finding one method that has no parameters and returns the same type as the record component. It only considers the parameters and return type (e.g., the method descriptor) as the metadata extraction works on obfuscated names, and the obf name of the record component may be different from the obf name of the corresponding getter. Also add a check to throw an exception when a getter could not be found for a record component, to easily detect these problems in the future. Partially addresses #8
- Loading branch information