Summary: | compiler must accept empty source files | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | vlad |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 2.0.1 | ||
Target Milestone: | 2.1 M2 | ||
Hardware: | PC | ||
OS: | All | ||
Whiteboard: |
Description
vlad
2002-10-08 14:19:07 EDT
Eclipse is performing an extra check, so as to ensure that the source file is located in the right directory structure matching its package declaration. javac doesn't care, at least if you compile these file by adding them onto the command line. If you only put these sources on its classpath, then it will require them to be properly laid out, so as to infer their location based on their qualified name. We relax the check for completely empty units (if you remove the comment, you'll notice we don't complain any longer). We thought this would be enough to accomodate people annoyed by the extra check, and you seem to have a use case where this is not flexible enough. Changed the implementation to only check for package expectation if the unit contains any structure (package, import, type). Comments alone are no longer sufficient to cause some reporting. Fixed. Also see bug 22418 for original same request for strictly empty files. Verified. |