Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2019-06-21 04:59:28 -0400
committerLars Vogel2019-06-21 05:36:29 -0400
commit8b4ed4f66f68932f9c2bd141ea8dfcc3dc1c9cdf (patch)
tree62efeebcc8769aa954e7f01271f2608daa1b4800 /org.eclipse.debug.ui/ui
parent28eafb0f03d500dd162f2151845d2644cfc5ab5c (diff)
downloadeclipse.platform.debug-8b4ed4f66f68932f9c2bd141ea8dfcc3dc1c9cdf.tar.gz
eclipse.platform.debug-8b4ed4f66f68932f9c2bd141ea8dfcc3dc1c9cdf.tar.xz
eclipse.platform.debug-8b4ed4f66f68932f9c2bd141ea8dfcc3dc1c9cdf.zip
Lamba optimization
Use method references if possible Remove unnecessary brackets Change-Id: I82c219171f7b3e459d4e2f70ae916d44d25fdc11 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.debug.ui/ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java2
8 files changed, 9 insertions, 10 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
index 171722530..e62b46e28 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
@@ -88,7 +88,7 @@ public class ImageDescriptorRegistry {
}
private void hookDisplay() {
- fDisplay.asyncExec(() -> fDisplay.disposeExec(() -> dispose()));
+ fDisplay.asyncExec(() -> fDisplay.disposeExec(this::dispose));
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
index f1073c598..9f0710e08 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/groups/GroupLaunchConfigurationTabGroup.java
@@ -19,6 +19,7 @@ package org.eclipse.debug.internal.ui.groups;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
@@ -642,9 +643,7 @@ public class GroupLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
}
modes = new LinkedHashMap<>();
modes.put(GroupLaunchElement.MODE_INHERIT, new InheritModeGroup());
- Set<ILaunchGroup> sortedGroups = new TreeSet<>((a, b) -> {
- return a.getLabel().compareTo(b.getLabel());
- });
+ Set<ILaunchGroup> sortedGroups = new TreeSet<>(Comparator.comparing(ILaunchGroup::getLabel));
LaunchConfigurationManager mgr = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
sortedGroups.addAll(Arrays.asList(mgr.getLaunchGroups()));
for (ILaunchGroup launchGroup : sortedGroups) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
index a613f13b8..0a261d7e9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
@@ -101,7 +101,7 @@ public abstract class AbstractLaunchConfigurationAction extends SelectionListene
return;
}
}
- Runnable r = () -> performAction();
+ Runnable r = this::performAction;
BusyIndicator.showWhile(getShell().getDisplay(), r);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index 1fbcbb768..48db0e51a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
@@ -699,7 +699,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
// create context menu
// create pop up menu for the rendering
createActions();
- IMenuListener menuListener = mgr -> fillContextMenu(mgr);
+ IMenuListener menuListener = AbstractAsyncTableRendering.this::fillContextMenu;
createPopupMenu(fTableViewer.getControl(), menuListener);
createPopupMenu(fTableViewer.getCursor(), menuListener);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
index ffb60bfc3..59ead6dfe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
@@ -94,7 +94,7 @@ abstract class PromptingResolver implements IDynamicVariableResolver {
String value = null;
setupDialog(argument);
- DebugUIPlugin.getStandardDisplay().syncExec(() -> prompt());
+ DebugUIPlugin.getStandardDisplay().syncExec(this::prompt);
if (dialogResultString != null) {
value = dialogResultString;
lastValue = dialogResultString;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
index cf12bcc2b..44c8a5b53 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
@@ -167,7 +167,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fTableCursor.addKeyListener(fCursorKeyAdapter);
- fCursorTraverseListener = e -> handleCursorTraverseEvt(e);
+ fCursorTraverseListener = this::handleCursorTraverseEvt;
fTableCursor.addTraverseListener(fCursorTraverseListener);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
index 073504821..fe10bfdd5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
@@ -557,7 +557,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
protected void createContextMenu(Control menuControl) {
MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(mgr -> fillContextMenu(mgr));
+ menuMgr.addMenuListener(this::fillContextMenu);
Menu menu= menuMgr.createContextMenu(menuControl);
menuControl.setMenu(menu);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
index 75928a8ba..21e0887d0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
@@ -1139,7 +1139,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
};
fTableCursor.addKeyListener(fCursorKeyAdapter);
- fCursorTraverseListener = e -> handleCursorTraverseEvt(e);
+ fCursorTraverseListener = this::handleCursorTraverseEvt;
fTableCursor.addTraverseListener(fCursorTraverseListener);

Back to the top