Consider a private method that is called from the JNI and is not used otherwise, generating a compiler warning about the unused method:
private void someMethodCalledOnlyFromJNI() {
This is some kind of legacy code in Java 1.4 - so no @SuppressWarnings .
What hack would you use to suppress this compiler warning?
Edit: Obviously, this is just a warning and can be easily ignored. But, personally, I hate warnings in my code just as I don't want to see errors in it. AFAIC - my code should have 0 warnings , this may be an exaggeration, but I am very pedantic in this.
As an example, someone can see this function, I donβt know that it is used from JNI and just removes it.
source share