Bug 13008

Summary: Move a Java file, errors remain
Product: [Eclipse Project] JDT Reporter: Jed Anderson <jed.anderson>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: rich
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on: 2857    
Bug Blocks:    

Description Jed Anderson CLA 2002-04-08 11:58:33 EDT
Build: 20020404

If you move a Java file that has errors in it from a source folder to somewhere
not on the build path the errors remain.  Then if you rebuild all, the error
disappears.  Moving the file to its previous location produces an error again.

To reproduce this problem:
1. Start with a new workspace
2. Switch to Java perspective
3. Create a Java project
4. Create a source folder "src", set the output folder to "bin"
5. Create another folder "not-src", but do not put it on the build path
6. Create a Java file in src, Foo.java.
7. Make an error in Foo.java.
8. Save, autobuild runs and you should get an error. (expected)
9. Move (either drag & drop, or move... from the popup) Foo.java to the folder
not-src
10. The error remains, even though the file is no longer being built. (<-- NOT
expected)
11. Rebuild all, the error disappears (expected)
12. Move Foo.java back, the error reappears (expected)
Comment 1 Erich Gamma CLA 2002-04-09 08:52:07 EDT
Markers are attached to a resource and move with the resource. When the file is 
moved out of the class path then the problem markers should be removed. 
Moving to JDT CORE for comment.
Comment 2 Philipe Mulet CLA 2002-04-09 09:51:50 EDT
We are addressing the case where a JAVA file becomes a non-java one (see bug 
2857). And this scenario is very similar to the other issue.

Now we cannot easily get rid of markers in the JavaModel update, since this one 
is implemented in term of POST_CHANGE event, where the resource tree is locked.

Post 2.0, we might want to revisit this and move the JavaModel update onto the 
PRE/POST_AUTO_BUILD change notification.

Comment 3 Philipe Mulet CLA 2002-04-09 09:52:40 EDT
Will reconsider post 2.0
Comment 4 Philipe Mulet CLA 2002-04-19 09:15:09 EDT
*** Bug 14193 has been marked as a duplicate of this bug. ***
Comment 5 Philipe Mulet CLA 2002-07-25 06:59:40 EDT
Reopening
Comment 6 Philipe Mulet CLA 2002-07-25 07:00:58 EDT
Clearing resolution
Comment 7 Philipe Mulet CLA 2002-07-31 10:36:00 EDT

*** This bug has been marked as a duplicate of 2857 ***