DESCRIPTION

Bug 432064 - ModelServiceImpl possible NPE and ClassCastException

- Refactor and Optimize the search tree
- Correction to invalid return elements when using IN_MAIN_MENU flag
- Add Null check early in findElement method
- Add tests
- Support any kind of MApplicationElement
- Change EModelService.ANYWHERE to include IN_MAIN_MENU and IN_PART

Change-Id: I7237cded1b337ac535ec5a8f82625deeed744615
Signed-off-by: Owen Strickland xxx@xxx.xxx

COMMENTS

author: Owen Strickland
date: 2014-04-14 02:54:41.000000000

Uploaded patch set 7.

-------------------------------------
author: Brenden Conley
date: 2014-04-14 02:54:46.000000000

Patch Set 7:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1879/

-------------------------------------
author: Brenden Conley
date: 2014-04-14 03:07:47.000000000

Patch Set 7: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/1879/ : SUCCESS

-------------------------------------
author: Jared Jackson
date: 2014-04-15 17:58:03.000000000

Patch Set 7: Code-Review-1

(2 comments)

Overall this looks pretty good. The reason for the -1 is that the EMF TreeIterator is far too aggressive in its search:

1) Hurts performance because it iterates *all* the transient and persistent data map contents for *every* element

2) Finds elements we aren't looking for (such as saved perspectives which are in the 'clonedSnippets' of the app.

I'll comment on the defect...

Line:488, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/internal/workbench/PartServiceImpl.java -> In the code below you just call 'findElements' on the MWindow itself, why not here as well ?

Also, reusing 'wElement' for two different iterator types confused me...

Line:93, bundles/org.eclipse.e4.ui.workLeon Ochoach/src/org/eclipse/e4/ui/workbench/modeling/EModelService.java -> Maybe we'd be better off if we just created a new constant ? We really shouldn't change the effect of existing API...

Paul just pointed out that we *must* not change this as it would break binary compatibility since it's a constant and thus the value gets compiled in...

-------------------------------------
author: Zaid Mosley
date: 2014-04-22 13:45:53.000000000

Patch Set 7:

Louis, any update here?

-------------------------------------
author: Owen Strickland
date: 2014-07-15 03:41:24.000000000

Abandoned

Done in another gerrit: Change-Id: I47beebc803899a7f095d0265632077810963cef9

-------------------------------------
