Community
Participate
Working Groups
When I move code with compile errors outside of a source folder, the compile errors are still reported. This is annoying since the reason why I'm moving this code out of the source folder is to keep it around in my project without having the compile errors. Steps to reproduce: - create a java project - create two packages each containing a class - add a class in each package (one of this class must have a must compile error) - go to the navigator view, find the package that contains the class that does not compile and move it at the root of the project - go back to the package explorer, you will notice that the problems are still reported. I would have expected the problems to be cleared. I have a project with a src folder. In this project I have multiple packages, one of which has compile errors.
I would expect that the builder takes care of removing the markers when the file is moved out of the source path. Happens when moving in Package Explorer as well as in Navigator.
We have code in place doing this; apparently there is a hole in our story.
This works for me using 3.3RC4.
Steps from comment 0 still show the problem in I20070615-1200: - paste this to empty Package Explorer: package a; public class A { } package b; public class B extends Invalid { } - in Navigator, drag folder /_pasted_code_/src/b (not B.java) to /_pasted_code_ => Error marker "Invalid cannot be resolved to a type" stays on _pasted_code_/b/B.java I'm not sure why I wrote "Happens when moving in Package Explorer as well" in comment 1, since it is not (and was not) possible to move a package to a folder or a project in the Package Explorer.
Thanks Markus. Reproduced as well. My mistake was to interpret 'it' in 'move it at the root of the project' as being the class. In fact 'it' is the package.
The Java builder should remove the markers when the delta corresponds to a .java file moved to a folder that is not on any classpath. Moving to Kent to resolve post 3.4
Created attachment 99131 [details] Proposed patch with testcase Added code used to 'move' a source file so it also handles moving a package
Fix for bug 2857 indeed did not consider folders. +1 for 3.4RC1
Released for 3.4RC1 Added IncrementalTests.testMovePackage2()
Verified for 3.4 RC1 using build I20080513-2000.