Community
Participate
Working Groups
class foo { public int bar; native void foobar(int bar); } produces a warning that the bar parameter in the native method hides the bar member. (I turned that warning on in Preferences > Compiler > Advanced.) Since native methods never have a body, this warning should IMHO not be issued fo native methods.
This has nothing to do with method bodies. The fact that an offending parameter is never actually used, doesn't mean its name is not poorly chosen.
I don't think the warning is about a poor name, but about a possible undesired effect (hiding a member). This can not happen here. The name may as well be quite ok, for example, if the Java code collects data, stores it in members, and makes one JNI call once it has all information. In that case the name is perfectly right for member as well as argument.
The purpose of this warning is to discourage choosing a name which already has a meaning elsewhere. This is why it is a poor name in our opinion, which makes the code less readable and more error prone. Not for 3.0
*** Bug 243917 has been marked as a duplicate of this bug. ***
As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you.