| Summary: | [override method] Wrong visibility on implemented methods from annotated interface | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lukas Eder <lukas.eder> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | deepakazad, manju656 |
| Version: | 4.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| See Also: | https://bugs.eclipse.org/bugs/show_bug.cgi?id=382690 | ||
| Whiteboard: | |||
Fixed by bug 387940 *** This bug has been marked as a duplicate of bug 387940 *** |
Build Identifier: Version: 4.2.0 Release Build id: I20120608-1400 Generated code from the Override/Implement Method feature has a wrong visibility, if the implemented method is declared in an interface and annotated Reproducible: Always Steps to Reproduce: Given the following code: ------------------------------ package test; public @interface Annotation { } ------------------------------ package test; public interface Interface { @Annotation void foo(); } ------------------------------ package test; public class Implementation implements Interface { // 1. Right-click to open context menu here // 2. Choose Source // 3. Choose Override/Implement Methods // 4. Click OK // 5. Generated method has package visibility instead of public visibility } ------------------------------ Follow the instructions in the Implementation class to get this: ------------------------------ package test; public class Implementation implements Interface { @Override void foo() { // TODO Auto-generated method stub } // Right-click to open context menu here // Choose Source // Choose Override/Implement Methods // Click OK // Generated method has package visibility instead of public visibility } ------------------------------ Note, this may be related to: https://bugs.eclipse.org/bugs/show_bug.cgi?id=382690