How to suppress Java compiler warnings for specific functions

If you really, really must do this, and you are sure you are not making a mistake, check out the @SuppressWarnings annotation. I suppose in your case you need

@SuppressWarnings("fallthrough")

Is the annotation @SuppressWarnings (javadoc) what you are looking for?

For example:

@SuppressWarnings("unchecked")
public void someMethod(...) {
    ...
}

Leave a Comment