Community
Participate
Working Groups
Bug 313922 was caused by additional PluginModelManagers being instantiated whenever a feature launch occurred. Each time a manager is instantiated it registers listeners that affect the java build path. To prevent bugs like this in the future we should prevent PluginModelManager from being instantiated. We can add a javadoc comment, make the constructor package visible (PDECore being the only place that should instantiate), and/or make the class a singleton (with getInstance() instead of a public constructor).
Created attachment 171259 [details] Patch
Fixed in HEAD
Looking at the code, there is some clean up that we should do here. The #getInstance() method on PluginModelManager should be synchronized to avoid having 2 instances created from different threads in a race condition. As well, since the singleton is cahced in the PluginModelManager class, PDECore should not keep a reference to the singleton either...(i.e. in fModelManager). It should always delegate to the #getInstance() method. In fact, none of the singleton objects in PDECore are created synch blocks, and this should be investigated (i.e. fModelManager, fTargetProfileManager, fFeatureModelManager...).
Created attachment 176544 [details] Additional patch Added synchronized and cleaned up PDECore
Created attachment 176579 [details] patch Added synchronization on creation of other singletons in PDE Core.
Applied/Fixed.