Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350020 - [ui] InstalledIUElement.equals/AvailableIUElement.equals should consider the parent element
Summary: [ui] InstalledIUElement.equals/AvailableIUElement.equals should consider the ...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: Juno   Edit
Assignee: Meng Xin Zhu CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-22 05:19 EDT by Meng Xin Zhu CLA
Modified: 2020-02-23 05:09 EST (History)
2 users (show)

See Also:


Attachments
proposed fix (2.14 KB, patch)
2011-06-22 05:20 EDT, Meng Xin Zhu CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Meng Xin Zhu CLA 2011-06-22 05:19:54 EDT
The available IU page has a checkbox viewer to show the available IUs that could be belonged to more than one category.

If using org.eclipse.jface.viewers.CheckboxTreeViewer.setSubtreeChecked(Object, boolean) to check the tree items, some duplicated items couldn't be checked. Because the implementation of CheckboxTreeViewer.setSubtreeChecked finds the tree item via the content's equals() method.
Comment 1 Meng Xin Zhu CLA 2011-06-22 05:20:51 EDT
Created attachment 198379 [details]
proposed fix
Comment 2 Pascal Rapicault CLA 2011-06-23 23:01:03 EDT
I'm not familiar with that code, could you please describe an example of where this will be happening and the sort of pb that could cause to the user? I may have misunderstood. Thx.
Comment 3 Meng Xin Zhu CLA 2011-06-28 01:30:25 EDT
(In reply to comment #2)
> I'm not familiar with that code, could you please describe an example of where
> this will be happening and the sort of pb that could cause to the user? I may
> have misunderstood. Thx.
Use the Indigo repository(http://download.eclipse.org/releases/indigo) in the install wizard, you can find 'PHP Development Tool' under three different categories(General purpose, Language and Web development tool).

The viewer is a checkbox tree viewer, clients might want to programmaticsly check the entire category such as 'Web development tool'. The clients probably calls the API org.eclipse.jface.viewers.CheckboxTreeViewer.setSubtreeChecked(Object, boolean) that find the children tree items via comparing to the data objects(call obj1.equals(obj2)).

Current implementation of AvailableIUElement.equals has flaw, the same name item(PHP Development Tool) under other categories might be checked.
Comment 4 Pascal Rapicault CLA 2011-06-28 17:38:13 EDT
Thx for the explanation. Go ahead and release the change. If you want to have this be backported to Indigo, please clone this bug and assign it 3.7.1.
Comment 5 Meng Xin Zhu CLA 2011-06-29 01:37:04 EDT
fixed in HEAD
Comment 6 Pascal Rapicault CLA 2011-06-29 05:25:26 EDT
Should you want to release it in 3.7.x please clone this bug for easier traceability
Comment 7 Meng Xin Zhu CLA 2011-06-29 05:29:25 EDT
(In reply to comment #6)
> Should you want to release it in 3.7.x please clone this bug for easier
> traceability
I see. But there is no strong reason to release it in 3.7.x. :)
Comment 8 Pascal Rapicault CLA 2011-06-29 06:42:07 EDT
Then I'm happy to not fix it for 3.7.x :)