Disable "not used" warning for public methods of a class

Vijaykumar Krishnaswamy picture Vijaykumar Krishnaswamy · May 29, 2011 · Viewed 44.5k times · Source

The new intellij upgrade (10.5) now shows a warning that some of the methods defined for a class are not being used. These methods are public and I plan on not using all of them as I have created them to support the API expected. I would like to disable this warning (not used for public methods in a class). Is there a way to do it?.

Answer

JT Montana picture JT Montana · Jan 10, 2015

You can disable it for a single method like this

@SuppressWarnings("unused")
public void myMethod(){...}