Bug 165892 - Changing persistent property on resource copy changes property in the original, too
Summary: Changing persistent property on resource copy changes property in the origina...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 3.3 M4   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
Depends on:
Blocks:
 
Reported: 2006-11-27 04:46 EST by Erwin Tratar CLA
Modified: 2006-11-29 12:10 EST (History)
0 users

See Also:


Attachments
Test case (8.69 KB, patch)
2006-11-28 11:16 EST, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erwin Tratar CLA 2006-11-27 04:46:17 EST
The implementation of PropertyBucket.PropertyEntry.PropertyEntry(IPath, PropertyEntry) is unsafe (as used for persistent properties on resources) in the sense that it copies over properties from the source by reference. It only creates a copy of the value[][] Array, but not of the individual arrays.

This leads to the following problem:

- copying a file, persistent properties are copied
- changing a persistent property on the copied file changes them also in the original file

Workaround:

- before setting the property on the copied file clear it first
Comment 1 John Arthorne CLA 2006-11-28 11:16:18 EST
Created attachment 54643 [details]
Test case
Comment 2 John Arthorne CLA 2006-11-28 17:48:32 EST
Fix released.
Comment 3 John Arthorne CLA 2006-11-29 12:10:19 EST
Where are my manners? I forgot to say, thank you very much for the excellent bug report.  Narrowing the problem down to the exact cause in the source code saved me a lot of investigation and effort. High quality bug reports like this are greatly appreciated.