| Summary: | Java Editor cannot resolve Classes named different than the filename | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jan Schnabel <jschnab> |
| Component: | Core | Assignee: | Kent Johnson <kent_johnson> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
The error annotation are coming form JDT/Core. This is an issue with secondary types. |
If a Java file contains classes beside the class that is named like the file name and these classes are not subclasses of this "main" class and the java file has not been opened in the editor the editor cannot resolve these classes. although the project compiles successfully. Example: a file Test.java contains two classes: class Test {} class Test2 {} Another file Main.java in the same package contains following: public class Main { Test2 test2 = new Test2(); } The editor marks a reference to Test2 from Main as error with the error message "Test2 cannot be resolved to a type" if and only if the file Test.java is not opened. Nevertheless the project compiles successfully.