Java method called with reflection only. Annotate?

Viewed 526

I have a bunch of classes named Process0, Process1, Process2 etc. inherited from a base class Process. Every child class includes the same static method. Future implementations may add more "ProcessNN".

I have to iterate all classes and call the same method from every class for specific data. It happened this static method is never called directly, only with reflection.

How can I mark/annotate this method in every class to remove warnings over "never used method" and preserve it from automatic code optimization?

Thanks.

1 Answers

You can add the @SuppressWarnings("unused") annotation to suppress compiler (and most IDE) warnings.

Related