Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Checking for inherited Subscribe/Produce annotated methods #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aheuermann
Copy link

I ran into the issue discussed in #109 & #26 today. I was able to workaround it by registering a separate event listener class, but it didn't seem ideal. Let me know what you think about this approach.
Thanks for the great library!

@JakeWharton
Copy link
Collaborator

This is a reasonable approach. And it's probably time to add it now that no one is supporting pre-4.0 (and if they are they can deal with the extra few nanos or simply not upgrade).

}

PRODUCERS_CACHE.put(listenerClass, producerMethods);
SUBSCRIBERS_CACHE.put(listenerClass, subscriberMethods);
}

static boolean shouldCheck(Class<?> clazz) {
String name = clazz.getName();
return !name.startsWith("java") && !name.startsWith("android");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need the "." otherwise "javasucks.Class" and "androidsucks.Class" names will incorrectly return true.

@aheuermann aheuermann force-pushed the inherited_methods branch 2 times, most recently from 84733f4 to d0b816f Compare January 5, 2015 08:28
@aheuermann
Copy link
Author

Updated. Let me know if this is closer to what you had in mind.

@filnik
Copy link

filnik commented Mar 23, 2015

Hi, is there any news about this feature? It would be really useful to have it in production :) (thanks aheuermann)

@WonderCsabo
Copy link

@JakeWharton any chance this will get merged soon? This would be a really useful feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants