Define scope for methods

Hi IntelliJ community.

When coding in our team it often occurrs that developers that aren't deep into the code are using blocking methods inside threads that should not be blocked (e.g. ui-thread).
To prevent this from happening I've thought about assigning a scope to those methods that can be colored by the IDE.
So the developer sees the method in a different background color and is reminded to check the thread he is running the method into.
Given the current project structure the blocking code is not seperated inside a seperate package but mixed up with all the other classes.

My idea was to create a source-level Annotation which can be used to annotate those blocking methods.
Is it somehow possible to define a scope for classes/methods that are annotated with a certain method?

Or does anyone have another solution that would achieve the same result?

We are using AndroidStudio (Idea 13).

Much thanks in advance,
McFarlane

Please sign in to leave a comment.