Community
Participate
Working Groups
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
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.
Also see bug 35907
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...
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.
Not for 3.0
reopening
Can be achieved in 1.5 mode using @SuppressWarnings annotation.