Skip to content

Conversation

@supersaiyansubtlety
Copy link
Member

@supersaiyansubtlety supersaiyansubtlety commented Nov 18, 2025

based on #339 to avoid having to work around SearchMappingsTest

Improves how RecordIndexingVisitor's finds record getters:

  • only methods with the required descriptor, legal access, and legal names (not toString, etc.) are considered getter candidates
  • if only one getter candidate is found, it's always chosen and considered a "definite" getter; this allows it to find getter overrides with non-default instructions in simple cases; before getters would not be found if they had non-default instructions
  • if multiple getter candidates are found, one is only selected if it has default getter instructions (as before) and its name matches the component field; this a "probable getter"; this is more strict than before and results in not finding a getter with a mismatched name that was previously found in a test; we can't actually be certain it's the getter, and this behavior matches decompilers'
  • if no getter candidates are found, an exception is thrown

Additionally, this exposes methods differentiating between "definite" and "probable" getters in RecordIndexingService because #333 will disallow directly naming definite getters (this PR was extracted from #333)

make SearchMappingsTest use its own, islolated jar
RecordIndexingVisitor: only check bytecode if multiple methods are getter candidates; allows finding overrides in simple cases
RecordIndexingVisitor: when there are multiple getter candidates, check name and descriptor in addition to bytecode; prevents some false-positives in getter finding (though false positives for non-getters are still possible)
@supersaiyansubtlety supersaiyansubtlety self-assigned this Nov 18, 2025
@supersaiyansubtlety supersaiyansubtlety added bug Something isn't working enhancement New feature or request backend affects the enigma backend refactor improvements that don't impact functionality labels Nov 18, 2025
@supersaiyansubtlety supersaiyansubtlety mentioned this pull request Nov 18, 2025
8 tasks
@supersaiyansubtlety supersaiyansubtlety force-pushed the improve-record-getter-handling branch 2 times, most recently from 713cc89 to 802004f Compare November 20, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend affects the enigma backend bug Something isn't working enhancement New feature or request refactor improvements that don't impact functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant