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
Check for PreferenceInjector.inject
call at compile time
#19
Labels
Comments
denley
added a commit
that referenced
this issue
Jul 25, 2015
Classes that contain at least one `@BindPref` annotation are now checked at compile-time to properly call PreferenceBinder.bind(this), and PreferenceBinder.unbind(this) (if there is at least one annotation without `listen=false`). This serves to shorten the length of time between the user forgetting the method call and becoming aware of the issue. Fixes #19
It turns out this is possible using java's Compiler Tree API. It has been implemented using a technique from this stackoverflow answer |
This feature seems to have some compatibility issues. It really needs to work perfectly as it can cause unfixable compilation errors when it functions incorrectly. I'm going to remove this feature pending extensive testing on a range of use cases and build cases. |
denley
added a commit
that referenced
this issue
Aug 3, 2015
The feature is unstable and pending unit testing and bug fixes. #19
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would improve UX to check that the user has properly called
PreferenceInjector.inject
andPreferenceInjector.stopListening
(if necessary) in the target class if there are annotations present.This may not actually be possible, especially when dealing with inheritance.
The text was updated successfully, but these errors were encountered: