Bug 44796 - [DCR] Special marker to remove unused argument warning
Summary: [DCR] Special marker to remove unused argument warning
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.1 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-14 02:14 EDT by Eric Estievenart CLA
Modified: 2005-05-30 05:26 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Estievenart CLA 2003-10-14 02:14:45 EDT
Considering:

public class MyClass {
  protected void doSomethingInDerivationIfNeeded( String s ) { // s is unused
    // default behaviour is: do nothing
    // derivations may need to override, and in that case
    // they really need the parameter
  }
}

When you enable the 'unuser parameters' warning,
there is no way to 'hide' the warning for the previous code,
like we would put a //$NON-NLS-1$ for unlocalized strings.
(the class is not and has not to be abstract)

Cheers
--Steve
Comment 1 Philipe Mulet CLA 2003-10-14 08:36:26 EDT
If we do go into this direction, then we will need to come up with a marker for 
each kind of optional diagnosis... we need to be careful.

I agree though that the current behavior isn't happy.
Comment 2 Philipe Mulet CLA 2003-10-14 08:39:07 EDT
Also see bug 35907
Comment 3 Eric Estievenart CLA 2003-10-14 12:35:29 EDT
What do you mean needing to be careful ?
You think 
1. it will add lot of extra comments in the code ?
2. Or we need to add several different markers ?

With all warnings enabled on quite large projects,
and after necessary cleanings, there are only a very few warnings
which need to be disabled by hand (provided the code quality is
correct), so 1. is not an issue for me.

For 2, provided there is a quick fix to 'hide' the warning,
nobody would have to know all the markers...
Comment 4 Jason Bennett CLA 2003-10-22 14:42:55 EDT
This would be very helpful for EJB development. ejbPostCreate requires you to
list all the parameters of ejbCreate, but the method is usually empty (and
therefore, the parameters are unused). Turning off the warning for that method
would be great.
Comment 5 Philipe Mulet CLA 2004-03-25 05:58:29 EST
Not for 3.0
Comment 6 Philipe Mulet CLA 2005-05-30 05:25:51 EDT
reopening
Comment 7 Philipe Mulet CLA 2005-05-30 05:26:06 EDT
Can be achieved in 1.5 mode using @SuppressWarnings annotation.