"Prohibited method" inspection?

Is there any way to have IntelliJ warn when a method is called other than modifying it and adding the @Deprecated annotation?

In our case, we never want "Collections.unmodifiableCollection", because we don't like its equals and hashCode semantics. We'd prefer IntelliJ to remind us not to use it rather than having to find it manually in Code Review.

There are probably other examples where a list of methods we don't want to be called would be nice. Does it exist?

1 comment
Comment actions Permalink

You can use Structural Search inspection (even with automatic replacement pattern) to highlight specific code patterns.

0

Please sign in to leave a comment.