| Summary: | java editor marks false errors for default access interface | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lukas Vosahlik <lukas.vosahlik> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | ||
| Version: | 2.1.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
This error is an artifact which only occurs in editor while typing. As you observed, it goes away when compiling the code (though the editor still shows it). It only occurs in presence of secondary types. The workaround is to define each type in its own file. |
The Java editor marks false errors when using an interface with default (package) access. The errors are not shown in Tasks or Package Explorer and the code can be compiled and run normally. How to reproduce: create a project containing package cz.netkit.test and 3 files: SomethingFactory.java, SomethingImpl.java and TestBug.java. File content: // SomethingFactory.java package cz.netkit.test; interface ISomething { } public class SomethingFactory { public static ISomething getIt() { return new SomethingImpl(); } } // SomethingImpl.java package cz.netkit.test; public class SomethingImpl implements ISomething // MARKED FALSE ERROR { } // TestBug.java package cz.netkit.test; public class TestBug { public static void main(String[] args) { ISomething it = SomethingFactory.getIt(); // MARKED FALSE ERROR } }