| Summary: | "Parameter is never read" warning for private methods only | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ryan F <rflegel> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P5 | CC: | amj87.iitr, greg.hutchinson, markus.kell.r, remy.suen |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Ryan F
(In reply to comment #0) > Having the warning trigger on public methods is an issue, because we often want > to keep the API intact, which means unnecessary warnings that we have to > suppress. You can tell the compiler to ignore parameters that are documented with the '@param' javadoc tag. Hi Remy, Thanks, I'm aware of that feature, but that would create a bunch of unnecessary documentation for us. It would be the same as having to suppress each warning. -- Ryan If it's an API that should stay stable, then it wouldn't hurt to document it. Having a special option just for private methods sound a bit arbitrary. Why not another one for package private methods and yet another one for protected methods? I wouldn't add this. You're right, too much customization might be a bit cumbersome. I see it being useful in the same way that "Unused local or private member" is useful. At the very least, I think the option should be there to ignore warnings for non-private members. I don't see a convincing reason to add the warning. It won't take much time to document the param in the API itself. Someone else can have such an argument for some other warning also to be suppressed for public methods. I think this customization should not be added. However - an unused parameter in a private method is always an error, where all the other visibility modifiers can produce false positives. Of course you wouldn't want to make a different warning for every visibility modifier, but in this case, I can see this as being really useful. |