Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registerAssociationAttribute does not take Inheritance into account #48

Closed
oberien opened this issue Feb 2, 2017 · 1 comment
Closed

Comments

@oberien
Copy link

oberien commented Feb 2, 2017

I investigated the problem @SalehAly reported here a bit.

SSCCE code

I have SuperClass and an extending SubClass. SuperClass has a public getter function, which I manually register using registerAssociationAttribute. If I stream SubClass.class and try to use that getter function, I'll get AnalyzerException: Unknown method foo encountered. Even if I register the method again on SubClass (which doesn't fail because the method is inherited), I still get the same error.

@my2iu
Copy link
Owner

my2iu commented Feb 5, 2017

There's actually two versions of registerAssociationAttribute(). You have to use the 4 argument version where you specifically pass in the subclass on which the method will be called. It's just a quirk of Java's reflection stuff.

@my2iu my2iu closed this as completed Feb 5, 2017
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

No branches or pull requests

2 participants