Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340221 - Setting enablement context variable on LibraryInstallDelegate causes refresh, even if no change
Summary: Setting enablement context variable on LibraryInstallDelegate causes refresh,...
Status: RESOLVED FIXED
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: Faceted Project Framework (show other bugs)
Version: 3.2.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.3 M7   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact: Konstantin Komissarchik CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 14:59 EDT by Paul Fullbright CLA
Modified: 2011-03-16 23:04 EDT (History)
0 users

See Also:


Attachments
Patch v1 (3.21 KB, patch)
2011-03-16 19:38 EDT, Konstantin Komissarchik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.