This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 431738 - EModelService#findElements API is not well-formed
Summary: EModelService#findElements API is not well-formed
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-01 13:55 EDT by Eric Moffatt CLA
Modified: 2014-04-29 11:19 EDT (History)
3 users (show)

See Also:
daniel_megert: pmc_approved+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Moffatt CLA 2014-04-01 13:55:21 EDT
The current API is:

public <T> List<T> findElements(MApplicationElement searchRoot, int searchFlags,
			Selector matcher);

As you can see there is no <T> to use to define the type of the returned list. We should add the 'Class<T> clazz' parameter to this method. Note that this can also be used to optimize the search tree in the future.
Comment 1 Paul Webster CLA 2014-04-01 14:11:46 EDT
Dani, this method which was introduced in M6 is not quite correct:

It should have been:
public <T> List<T> findElements(MApplicationElement searchRoot, 
Class<T> clazz,
int searchFlags,
Selector matcher);

Where Class<T> serves to both help scope what's being searched and provide the generic information for the List<T> returned.

I'd like permission to add this argument now in M7.  We'll announce it on the lists.

PW
Comment 2 Eric Moffatt CLA 2014-04-01 14:27:47 EDT
I've pushed the following patch to Gerrit:

  https://git.eclipse.org/r/24279

This the new API take a 'Class<T> clazz' parameter and adjusts the other API that funnel into this one to match. It also add the parameter directly to the internal 'findElementsRecursive' to make everything symmetric.
Comment 4 Markus Keller CLA 2014-04-06 16:01:09 EDT
Fixed Javadoc problems in org.eclipse.e4.ui.workbench.modeling.EModelService.findElements(MUIElement, String, Class<T>, List<String>, int) again:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=888ba032283fcbb21ef8291847ad07b1c8892456
Comment 5 Eric Moffatt CLA 2014-04-29 11:19:20 EDT
Verified in 4.4.0.I20140428-2000.