Community
Participate
Working Groups
Preference option to save resource upon modification is turned on (Not sure if that is relevant in this case) If I have a java class that has errors and I rename it to be a .txt file the errors in the Task list do not go away (I have to do a rebuild to get the errors to go away). However, if I rename it back to .java, the errors show up right away, without a rebuild. STEPS: *Create the following class in a Java project in the Resource Perspective: public class TaskClass { private int y; public TaskClass() { } public void doThis() { } abstract public void doThat(); public int getX() { return x; } } Notice in the Tasks list that there are 2 errors. *In Nav, Rename TaskClass.java to TaskClass.txt. BUG: Notice that the errors are still there workaround: Do Project-> Rebuild All to make the errors go away. NOTES:
PRODUCT VERSION: eclipse sdk 135 winnt 4.0
Build 20020321 I encountered a similar problem when I renamed a package. Renaming the package caused several errors within the package to be fixed. However the errors still appeared in the task list. Steps to repeat: Create a new file named foo/Foo.java: package foo; public class Foo { public static void main(String[] args) { new baz.Foo(); } } An error will appear because baz.Foo is undefined. Rename the package 'foo' to 'baz'. The class will no longer be tagged as a problem, but the problem remains in the task list. Rebuilding (or even building) the project does not seem to fix the problem. Rebuilding the workspace also does not fix the problem. How do I get rid of these tasks???
Note that Peter's problem was fixed along with Bug 12269. The first problem happened to me too. Basically renaming a Java file with problems to a text file carries the markers with it. Since the new file isn't a java file, I would assume that the java builder doesn't clear the problems because its not compiling the new text file. Doing a rebuild on the project removes all java problems and thus gets rid of this bogus error. Should the java problems be removed on a resource move? (note: consider autobuild on/off here?) Moving to JDT/Core for comment.
I don't see why autobuild would make any difference here, I think the builder is innocent... however, there is clearly is an issue with moving resources with problems. I think the Java problems should always be cleared if the target resource is not a JAVA file...
We need to remove the markers in the delta processor. However this can be done only when resource modification is allowed (i.e. during PRE_AUTO_BUILD or POST_AUTO_BUILD). We would have to move the delta processing in either of these events. This is a major change and will not occur before 2.0.
Reopening
Clearing resolution
*** Bug 13008 has been marked as a duplicate of this bug. ***
We should record these in a list of files which need to have their problem markers flushed, which the Java builder will process when building so as to remove all their markers.
Java builder is creating these markers so it's up to the Java builder to delete those. Fixed Java builder to remove problems and tasks for a compilation unit that is deleted and that has the MOVE_TO flags set. If the target file is a compilation unit, the new cu will be recompiled and new markers added. If the target file is a non-java resource (as in this bug), then markers are removed.
Verified.
*** Bug 14340 has been marked as a duplicate of this bug. ***