Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367096 - [dstore] DataElement.isSpirit() may return true for newly created DStore objects
Summary: [dstore] DataElement.isSpirit() may return true for newly created DStore objects
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 367097
  Show dependency tree
 
Reported: 2011-12-19 11:22 EST by Petar Petrov CLA
Modified: 2012-02-06 09:37 EST (History)
2 users (show)

See Also:


Attachments
patch to clear spirit bit when getting a recycled DataElement (1.30 KB, patch)
2011-12-19 11:34 EST, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petar Petrov CLA 2011-12-19 11:22:54 EST
Build Identifier: I20110613-1736

DataElement.isSpirit() may return true for newly created DataElement objects if they were retrieved from the cache of recycled elements.

Reproducible: Always

Steps to Reproduce:
In our code we call one of the DataStore.createObject() methods. It will call DataStore.createElement() which will try to retrieve an element from a cache of recycled elements. This cache may contain spirits - elements that were handled by DataElementRemover.
The problem is that createObject() will never change the spirit state of elements retrieved from the cache of recycled elements. This means that your newly created DataElement instance will return true for isSpirit() although that is obviously incorrect.
Comment 1 David McKnight CLA 2011-12-19 11:34:47 EST
Created attachment 208566 [details]
patch to clear spirit bit when getting a recycled DataElement
Comment 2 David McKnight CLA 2011-12-19 11:35:08 EST
Petar, does this patch solve the problem?
Comment 3 David McKnight CLA 2011-12-19 11:36:55 EST
I've created bu 367097 to backport the fix to the 3.2.x version.
Comment 4 Petar Petrov CLA 2011-12-20 03:14:46 EST
(In reply to comment #2)
> Petar, does this patch solve the problem?

Looks like it should solve it. We've implemented a similar workaround in our code for the time being - call setSpirit(false) after every call to createObject(). I'll be able to retest once the patch is released as part of an official release and we upgrade our target platform to it.
Comment 5 David McKnight CLA 2011-12-20 10:10:39 EST
Okay, I've committed the patch to the HEAD stream.