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-09 03:50:51.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2014-04-09 03:50:56.000000000

Patch Set 5:

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

-------------------------------------
author: Brenden Conley
date: 2014-04-09 04:04:39.000000000

Patch Set 5: Verified+1

Build Successful 

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

-------------------------------------
author: Owen Strickland
date: 2014-04-09 04:06:26.000000000

Patch Set 5:

@Eric: I did the change you asked.
But before merging it, I would like to review something in more detail.

I ran an existing test:
org.eclipse.e4.ui.tests.application.EPartServiceTest
because this test use refactored methods indirectly.

There is 8 tests that failed...but I would like to discuss review with you some logic.  I'm almost sure the new code is doing the right thing and I understand why the test are failing.

Basically, they fail because in the class:
org.eclipse.e4.ui.internal.workLeon Ochoach.PartServiceImpl

In the method:
public MPart showPart(MPart part, PartState partState)

at line 1109 : MPart addedPart = addPart(part);

inside the method addPart it try to find the part by Id and there is some logic if it find it or not.....

The problem is....
With the new code, it find the part and with the old code it doesn't and it change the result of the test !

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