Exclude a specific method names from the unused declaration inspection

Answered

I want to exclude certain method names from the unused declaration inspection. For example: when using the EventBus library in an Android project, we have methods with names like onEvent and onEventMainThread.

I could not find a way to exclude those methods from the unused declaration inspection and I do not want to annotate every single method with the @SuppressWarnings annotation. I would be nice to exclude certain method names (with wildcards perhaps line onEvent*) from the unused declaration inspection.

Is this possible?

0
4 comments

Did you check the entry points configuration?

0

I should have mentioned I am using Android studio. I checked it in Idea and the option is indeed present. In Android Studio it seems to be missing (2.3 canary 2), see the attached screenshot. Is this a bug or is this on purpose?

0

It's a very recent change that is not yet merged into Android Studio.

0

Ok, thanks for the info!

0

Please sign in to leave a comment.