Bug 13905

Summary: changes to read-only .classpath file are not thrown out
Product: [Eclipse Project] JDT Reporter: Jed Anderson <jed.anderson>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: erich_gamma
Version: 2.0   
Target Milestone: 2.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Jed Anderson CLA 2002-04-16 11:49:40 EDT
Build: 20020409

1. Make a project, ProjA.
2. Change ProjA's .classpath file to read-only.
3. Open the Java Build path properties on ProjA, and change the output directory
to be bin.
4. Hit ok, the save fails with an error.
5. Close the properties dialog.
6. Open the properties on ProjA again.
7. The the output path is still bin. <- bug

Note:  The .classpath file does not change (as expected)
Comment 1 Philipe Mulet CLA 2002-04-22 19:09:45 EDT
We should re-read the file contents if unable to write over it.
Comment 2 Philipe Mulet CLA 2002-04-23 06:43:01 EDT
Changed the implementation to perform file saving before applying the classpath 
change. If unable to write, then the change is a noop.

Fixed
Comment 3 Philipe Mulet CLA 2002-04-23 08:41:48 EDT
*** Bug 6165 has been marked as a duplicate of this bug. ***
Comment 4 Philipe Mulet CLA 2002-07-11 06:55:44 EDT
Backporting this fix to 1.0 stream. Fix for it is slightly different for 
reducing the amount of touched code. We simply restore old classpath, build 
order and classpath markers if exception is thrown while writing classpath file.

Released in version 'v_144'.
Comment 5 Philipe Mulet CLA 2002-07-11 11:37:23 EDT
Actually, also need to protect the SetOutputLocationOperation as well.
Fix released into v_144a