Bug 212031 - Need to reset CSettingEntryFactory when loading/applying configurations
Summary: Need to reset CSettingEntryFactory when loading/applying configurations
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 4.0.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 4.0.3   Edit
Assignee: Ken Ryall CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-12-05 11:56 EST by Warren Paul CLA
Modified: 2012-01-28 17:52 EST (History)
2 users (show)

See Also:


Attachments
proposed patch (1.29 KB, patch)
2007-12-05 11:58 EST, Warren Paul CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Warren Paul CLA 2007-12-05 11:56:32 EST
Build ID: M20071023-1652

Steps To Reproduce:
When loading and applying configuration data, a CSettingEntryFactory is created once and passed into each configuration.  It's not cleared in between, and therefore the maps from the factory exist for the other build configs.

It's not really clear to me exactly what this factory is for, but I do know that when not cleared, the values from the first config override those from other configs.  The result is that the set of macros used in the scanner info for build config B is really the set of macros form build config A.

The code was creating the factory, passing it to all configs, and then clearing it.  That doesn't make much sense and I assume it was intended to clear it after each config.   But again, I don't really understand the point of this factory to begin with.



More information:
Comment 1 Warren Paul CLA 2007-12-05 11:58:27 EST
Created attachment 84544 [details]
proposed patch

Proposed patch which clears the factory between configs
Comment 2 Ken Ryall CLA 2008-01-18 16:23:11 EST
Applied patch to HEAD and cdt_4_0
Comment 3 Andrew Gvozdev CLA 2012-01-28 17:52:03 EST
I believe that the real root cause was fixed in bug 284699. According to my findings CSettingEntryFactory is mere cache implemented to give you a challenge as multidimentional map. It is difficult to deal with multidimentional maps, especially with no generics in Java 1.4, and a bug slipped for macros where all macros with the same name were counted as same one.