DESCRIPTION

Bug 478939 - Use Lambdas in org.eclipse.e4.ui.workLeon Ochoach.swt

Change-Id: I4e42aded3d59f68e28ed443be8d52a7cf004da5b
Signed-off-by: Zaid Mosley xxx@xxx.xxx

COMMENTS

author: Zaid Mosley
date: 2015-10-03 05:45:14.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-10-03 06:15:12.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2015-10-03 06:29:47.000000000

Patch Set 1: Verified-1

Build Failed 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/6899/ : FAILURE

-------------------------------------
author: Mariela Flores
date: 2015-10-04 08:03:07.000000000

Patch Set 1: Code-Review-1 Verified-1

In BindingProcessingAddon I'd move the event-handler code to methods eg 

private void additionHandler(Event evt) {
}

and then:

broker.subscribe(UIEvents.BindingTableContainer.TOPIC_BINDINGTABLES,
				this::additionHandler);


broker.unsubscribe(this::additionHandler);

BTW:

unregsiterModelListeners looks very strange why do we unsubscribe 4 times!

-------------------------------------
author: Mariela Flores
date: 2015-10-04 08:15:51.000000000

Patch Set 1: -Verified

(6 comments)

I added my preferred changes to the files - they are all not mandatory but i think they even improve the code more. I know it is is a personal preference but if a lamda exceeds more then 5 lines I'd vote for moving the code to a method and use a method-reference (if more information in outscope is captured I'd do this if there are more than 15 lines, still use a lambda then and call to the outer method)

Line:196, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/AnimationEngine.java -> i this could be "feedbackRenderer::dispose"

Line:59, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SelectionAdapterFactory.java -> could this be "return ((IStructuredSelection) sel)::iterator"

Line:62, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SelectionAdapterFactory.java -> could this be "return list::iterator"

Line:71, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SelectionAdapterFactory.java -> could this be "return ss::size"

Line:681, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/FilteredTree.java -> I'd move this code to a method and use this::traverseListener but only if the code does not capture any local stuff

Line:313, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java -> I'd make this a method and use this::additionHandler in the subscribe/unsubscribe

-------------------------------------
author: Erick Ross
date: 2016-09-16 07:25:59.000000000

Patch Set 2: Patch Set 1 was rebased

-------------------------------------
author: Zaid Mosley
date: 2016-12-19 16:29:07.000000000

Patch Set 1:

(6 comments)

Line:196, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/AnimationEngine.java -> Done

Line:59, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SelectionAdapterFactory.java -> Done

Line:62, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SelectionAdapterFactory.java -> Done

Line:71, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/internal/workbench/swt/SelectionAdapterFactory.java -> Done

Line:681, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/workbench/swt/internal/copy/FilteredTree.java -> I leave that for a later change. I don't want to mix to much manual and automatic changes

Line:313, bundles/org.eclipse.e4.ui.workLeon Ochoach.swt/src/org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon.java -> I will open another bug to convert these xxx@xxx.xxx method registrations.

-------------------------------------
author: Gerrit Code Review
date: 2016-12-20 08:02:08.000000000

Change has been successfully merged into the git repository by Zaid Mosley

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