EventBus icon indicating copy to clipboard operation
EventBus copied to clipboard

Warnings when using generics with 3.0

Open rubengees opened this issue 9 years ago • 6 comments

Like I stated in https://github.com/greenrobot/EventBus/issues/249 I get warnings when I use generics with the indexer. This itself wouldn't be a problem, but Android Studio automatically switches to the code fragment where this happens, interrupting my current workflow which is somehow annoying.
The warning I get is like this (In the Gradle messages window):

Error:(196, 26) Note: Using upper bound type com.myapplication.event.IListEvent<T> for generic parameter

Would it be possible to degrade that warning so I get only notified about it, but without switching to the warning?

rubengees avatar Feb 12 '16 13:02 rubengees

EventBus uses https://docs.oracle.com/javase/7/docs/api/javax/tools/Diagnostic.Kind.html#NOTE, which is supposed to be informational. Maybe we should add some option to turn those off completely if Android Studio makes a drama out of that. ;)

How about: nolog=all // turn off all NOTE logs nolog=generics // info when generics are used nolog=fallback // info when indexer cannot index (EventBus will fallback to reflection)

Or maybe even better, make generics logs appear only in verbose mode (there's a option for that already)? nolog=fallback might still make sense.

greenrobot avatar Feb 12 '16 13:02 greenrobot

That would be great. It's not a big of an issue but still annoying. I'm a friend of the verbose option.

rubengees avatar Feb 12 '16 20:02 rubengees

I made a pull request to include the nolog option and only log generics when verbose is activated :)

bishiboosh avatar Aug 26 '16 14:08 bishiboosh

@greenrobot Could the pull request made by @bishiboosh be merged ? Thanks !

jrdaher avatar Sep 07 '21 13:09 jrdaher

@jrdaher I just realized (ok, 5 years later) that there is a minor issue, I will fix it and push.

bishiboosh avatar Sep 07 '21 14:09 bishiboosh

Done, and rebased on current master

bishiboosh avatar Sep 07 '21 14:09 bishiboosh