Bug 171797 - improve FilteredItemsSelectionDialog.ItemsFilter.equalsFilter(ItemsFilter)
Summary: improve FilteredItemsSelectionDialog.ItemsFilter.equalsFilter(ItemsFilter)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 171058 171368
  Show dependency tree
 
Reported: 2007-01-26 09:18 EST by Markus Keller CLA
Modified: 2007-06-05 16:32 EDT (History)
3 users (show)

See Also:


Attachments
Patch file including javadoc fixes. (53.02 KB, patch)
2007-02-02 11:02 EST, Tomasz Zarna CLA
no flags Details | Diff
Updated version of the patch (55.72 KB, patch)
2007-02-16 12:04 EST, Tomasz Zarna CLA
no flags Details | Diff
Updated version of the patch for FISD class (46.67 KB, patch)
2007-02-20 11:26 EST, Tomasz Zarna CLA
no flags Details | Diff
Part of the updated patch for JDT (1.31 KB, patch)
2007-02-20 11:26 EST, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-01-26 09:18:18 EST
I20070123-1715

The Javadoc of FilteredItemsSelectionDialog.ItemsFilter#equalsFilter(ItemsFilter) does not tell how this method is used. It should
- tell whether the method is symmetric like Object#equals(..)
- or even better: tell that subclasses of FilteredItemsSelectionDialog can be sure that the arguments to equalsFilter(ItemsFilter) are only filters returned from their createFilter() method (=> clients can avoid instanceof checks then)


Furthermore, current implementations of that method are questionable:

- FilteredItemsSelectionDialog.ItemsFilter.equalsFilter(ItemsFilter) checks for "iFilter != null", although the constract does not allow iFilter to be null

- FilteredResourcesSelectionDialog.ResourceFilter.equalsFilter(ItemsFilter) and FilteredTypesSelectionDialog.TypeItemsFilter.equalsFilter(ItemsFilter)
call "super.equals(iFilter)". Should be "super.equalsFilter(iFilter)"
Comment 1 Tomasz Zarna CLA 2007-02-02 11:02:48 EST
Created attachment 58121 [details]
Patch file including javadoc fixes.

This patch is the result of general code review of FilteredItemsSelectionDialog. I focused mainly on Javadoc comments, about which Markus was concerned so much. However, the patch includes also some minor code fixes in FilteredItemsSelectionDialog as well as in subclasses (FResourcesSD and FTypesSD).
I am aware that this patch doesn't make Javadoc contracts in all theses classes flawless. However, releasing this patch and logging some comments as new bugs would be appreciated. Especially, due to the fact that this patch introduce changes among almost whole class. Maintaining the patch file (keeping it up-to-date) is going to be "Sisyphus work".
Comment 2 Tomasz Zarna CLA 2007-02-16 12:04:12 EST
Created attachment 59166 [details]
Updated version of the patch
Comment 3 Tod Creasey CLA 2007-02-19 10:53:20 EST
Patch for ide and workbench commited for build >20070219 but as I am not a JDT commiter you will need a seperate patch for them.
Comment 4 Tod Creasey CLA 2007-02-19 13:29:09 EST
I had to back out of this patch as it was pretty big and I needed to get the patch  for Bug 172005 in before the build today (sorry).

Could you update the patch for ide and workbench please?
Comment 5 Tomasz Zarna CLA 2007-02-20 03:45:41 EST
I will update the patch as soon as the patch for Bug 172005 is released. I will split it into two seperate patches: one for JDT, one for you.
Comment 6 Tomasz Zarna CLA 2007-02-20 11:26:11 EST
Created attachment 59384 [details]
Updated version of the patch for FISD class

This is the patch file only for FISD class. Part for FRSD has been already applied. Part for FTSD (JDT) is comming soon....
Comment 7 Tomasz Zarna CLA 2007-02-20 11:26:55 EST
Created attachment 59385 [details]
Part of the updated patch for JDT
Comment 8 Tod Creasey CLA 2007-02-20 12:31:19 EST
Patch released for build >20070220
Comment 9 Markus Keller CLA 2007-02-26 09:38:21 EST
(In reply to comment #7)
Thanks, applied JDT/UI patch to HEAD. Filed bug 175524 for further API problems.