Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340221

Summary: Setting enablement context variable on LibraryInstallDelegate causes refresh, even if no change
Product: [WebTools] WTP Common Tools Reporter: Paul Fullbright <paul.fullbright>
Component: Faceted Project FrameworkAssignee: Konstantin Komissarchik <konstantin>
Status: RESOLVED FIXED QA Contact: Konstantin Komissarchik <konstantin>
Severity: normal    
Priority: P3    
Version: 3.2.3   
Target Milestone: 3.3 M7   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch v1 none

Description Paul Fullbright CLA 2011-03-16 14:59:17 EDT
(Occurs in 3.3 M5)

In LibraryInstallDelegate.setEnablementContextVariable(String, Object), a refresh is always called, even if the variable has not changed.  (There is also no way to determine what the current variable value is, so that this could be avoided.)  This causes a StackOverFlowError in my case because I'm responding to changes in the library provider delegate by setting the variable.

Also, in refresh(), a property change is fired for available providers, even if the list of providers has not changed.  An equality check could be made here, much like two lines later where the selected provider is checked before firing a property change.
Comment 1 Konstantin Komissarchik CLA 2011-03-16 19:38:36 EDT
Created attachment 191367 [details]
Patch v1

This patch adds same value check to setEnablementContextVariable method. Making refresh method not trigger available providers changed event every time would require fairly extensive changes to the refresh method. It is not as simple as adding an equality check at the end. My hope is that this patch is sufficient to unblock Bug 340175, in which case we can refresh method separately if/when necessary.
Comment 2 Konstantin Komissarchik CLA 2011-03-16 23:04:02 EDT
Tested and released the patch into 3.3 M7 build.