Summary: | Eclipse is identifying package errors while the actual useage is correct (it compiles). | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | David Seever <dlseever> | ||||
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> | ||||
Status: | RESOLVED WORKSFORME | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.1.2 | ||||||
Target Milestone: | 3.3 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
David Seever
2006-07-20 15:35:47 EDT
Not sure to understand what is the problem here, if you have following test case: x/y/z/w/Test.java: package x.y.z; public class Test {} Then using 3.1.2, there's a compile error which correctly states "The declared package does not match the expected package x.y.z" and quick-fix correctly proposes either to move the CU to x.y.z package or change package declaration to x.y.z.w. I surely miss something, can you provide more details on your offending test case? From what directory are you compiling your file? Created attachment 48144 [details]
Simple test to show that it can compile
Compiling using JDK 1.4.2_12 from the cmd line on WinXP
Make directory c:\a\b\c\d
in directory "d" make a java file named Test.java
inside the file
pacakage a.b.c.d;
class Test {
public static void main(String [] argv){
//do not need to put anything, but maybe System.out
}
}//class Test end
When searching for source files, the directory must match the expected package or the type cannot be found. We generate an error so the user can correct this problem. We do not consider this to be a bug, but a case where we differ from javac. |