Community
Participate
Working Groups
Build 20020921 M1 Create a workspace and fill it with the following source (it's also attached as JAR): <workspace>/a/b/c/A.java: package a.b.c; public class A { public void doIt() { } } <workspace>/Test.java import a.b.c.A; public class Test { void doIt() { new A().doIt(); } } Rebuild All Change the package declaration in A.java to "package a.b.c.d;" Save (NOTE: Ensure that refactoring does not fix/change the files.) Rebuild All Only 1 error marker (on A.java) Now look at Test.java: ==> there is no error marker (--> is the file OK? No) but quick fix and quiggly lines are drawn in the editor. When doing the same test scenario in Eclipse 1.0 I get 1 error marker on A.java and also 2 error markers on Test.java (which is OK).
sorry wrong component - moving to JDT Core
I presume you meant <project> instead of <workspace>.
Of course - stupid me
The difference is because of the Java builder change from 1.0 to 2.0. The 2.0 Java builder produces a .class file a/b/c/A.class even after the change to the package declaration. This is not a bug... just a consequence of changing the builder & how it handles this error.
OK - so you say that the class with the wrong package declaration gets generated as if the package declaration was correct i.e. A.class is identical to the class that got generated if the package declaration would be correct? Does the Java spec not define how errors have to be reported? The problem with the 2.0 behavior is that if I take the source and then build with JDK it will fail, right?