johncarl81 / transfuse

:syringe: Transfuse - A Dependency Injection and Integration framework for Google Android
http://androidtransfuse.org/
Apache License 2.0
220 stars 28 forks source link

base class with @UIThread annotations seem to be ignored #165

Closed dbachelder closed 9 years ago

dbachelder commented 9 years ago

I have a base class with @Observes and @UIThread annotations on a method. The observer is wired up in the generated component (a fragment delegate that inherits directly from the base class), but the call is not wrapped in a UIThreadMethodInterceptor. The end result is that the method is called on whatever thread trigger() is called on.

johncarl81 commented 9 years ago

Shoot, we're probably not searching the parent classes at some point. Will investigate.

johncarl81 commented 9 years ago

Here's the culprit: https://github.com/johncarl81/transfuse/blob/master/transfuse-core/src/main/java/org/androidtransfuse/analysis/astAnalyzer/AOPProxyAnalyzer.java#L70-L71

I'm trying to remember why I only wanted to support AOP proxies on the "top level" sub class. We should gracefully handle extensions.

johncarl81 commented 9 years ago

This should do the trick: 74f1d27d255c5178c388767ad9d762e26d4a62fd

Looking back, AOP should only be applied on the Type level at the root class, methods are a different story though. Can you test @dbachelder?

dbachelder commented 9 years ago

@johncarl81 is this deployed to maven? If not, I might try to see if I can get https://jitpack.io/ working with transfuse... might be easier for testing snapshots than having to deploy them to maven all the time..

dbachelder commented 9 years ago

This seems fixed!