| Summary: | Future request. Warnings if we do not use a public method | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lars Svensson <oxvalley> |
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
| Status: | VERIFIED INVALID | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | amj87.iitr, Olivier_Thomann, srikanth_sankaran |
| Version: | 3.7 | ||
| Target Milestone: | 3.7 M1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Lars Svensson
The idea behind the warning is that you should be able to
get rid of the complained against item, say by using a
quick fix offered by the IDE, or otherwise by manually.
Given public methods are exposed to the whole wide world,
there could be parts of the code not seen by the compiler
that use the method. This will trigger the warning for most
API methods, where there is no usage "locally" - i.e, the
client code that uses these methods is compiled independently.
See that in cases like what is shown below, the compiler
does produce a warning as appropriate: because the region
of code where such a public method is usable is well bounded
by the language specification, the compiler can and does
verify usage:
public class Tools {
private class Private {
public void foo() {
}
}
Private p = new Private();
}
For more general cases, I doubt that anything could be done that
would not also open the flood gates for numerous other pointless
or just plain incorrect warnings.
As Srikanth explained, there is nothing we can do for public methods. Closing as INVALID. Verified for 3.7M1 |