Bug 55696 - Wrong warning about parameter names in native methods
Summary: Wrong warning about parameter names in native methods
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-23 11:10 EST by Robert Wenner CLA
Modified: 2009-08-30 02:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Wenner CLA 2004-03-23 11:10:44 EST
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.
Comment 1 Philipe Mulet CLA 2004-03-24 06:56:59 EST
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.
Comment 2 Robert Wenner CLA 2004-03-24 07:10:15 EST
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.
Comment 3 Philipe Mulet CLA 2004-03-25 05:57:52 EST
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
Comment 4 Dani Megert CLA 2008-08-13 03:03:11 EDT
*** Bug 243917 has been marked as a duplicate of this bug. ***
Comment 5 Denis Roy CLA 2009-08-30 02:19:47 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.