You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Honor Nullable/Nonnull method signature annotations when generating code #782
The integration of Otto consist in copying @Produce and @Subscribe annotations in the generated class, so the behavior will be the same.
More generally, all runtime annotations should be copied in the generated class so that the other framework won't even know that we are using AA and it should work fine.
The issue appears when you are using two annotations processors.
But, if you can specify the order of processing, you can have both frameworks working together.
For example, if you use AA and johncarl81's parceler, and parceler is processing after AA, you can annotate a class with both @EBEan and @Parcel and it will work fine because parceler will process both the base and the generated class.
About the frameworks integrated by AA, they are :
Otto : copying annotations will enable us to remove the integration (ProduceHandler and SubscribeHandler.
RoboGuice : There are annotations on fields, not method. So, there is no overriding so no problem.
GreenDroid, SherlockActionBar, HoloEverywhere : No annotations
OrmLite : It's not a common case to have a POJO being annotated with @EBean. But, if someone does it, it will need annotations to be copied to the generated class.
Thanks for the detailed explanation!
I think your are right.
About Ormlite: It does not uses any method annotations, but one class annotation @DatabaseTable. That should be copied, too, if there is no annotation on the generated class, it will be persisted to another table, and use another DaoClass. But you are right: using any AA annotation on OrmLite-persisted classes is a bad practice and should be avoided.
More generally, all runtime annotations should be copied in the generated class so that the other framework won't even know that we are using AA and it should work fine.
Please copy Nullable/Nonnull annotations into the generated (via Background, UIThread annotations) method's signature to avoid code inspection warnings (e.g. in IDEA).