Skip to content

Fix PropertyFinder not discovering inherited getter/setter pairs in METHODS mode#4269

Draft
evanchooly wants to merge 1 commit into
masterfrom
claude/critter-fix-method-hierarchy
Draft

Fix PropertyFinder not discovering inherited getter/setter pairs in METHODS mode#4269
evanchooly wants to merge 1 commit into
masterfrom
claude/critter-fix-method-hierarchy

Conversation

@evanchooly
Copy link
Copy Markdown
Member

Summary

  • discoverPropertyMethods() only inspected the immediate ClassNode, so getter/setter pairs declared in parent classes were silently omitted when PropertyDiscovery.METHODS was active
  • A child entity whose property accessors come entirely from a base class would have zero properties mapped under METHODS mode
  • Fix walks the superclass chain the same way discoverAllFields() already does; subclass overrides take precedence via a seen map

Test plan

  • TestCritterMapper#testInheritedGetterDiscoveryInMethodsMode — new test with MethodsBase (defines getName/setName) and MethodsChild extends MethodsBase (@Entity); verifies name property is discovered
  • All 12 TestCritterMapper tests pass

https://claude.ai/code/session_01788qAtGdn41QnwBvd8JeJr


Generated by Claude Code

…ETHODS mode

discoverPropertyMethods() only inspected the immediate ClassNode, so getter/setter
pairs declared in parent classes were silently omitted when PropertyDiscovery.METHODS
was active. This caused child entities to have no properties at all if all their
property accessors came from a base class.

Walk the superclass chain the same way discoverAllFields() already does, tracking
seen property names so a subclass override takes precedence over the parent's method.

https://claude.ai/code/session_01788qAtGdn41QnwBvd8JeJr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants