Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-01-20 15:16:40 +0000
committerLars Vogel2020-01-23 16:36:14 +0000
commit012adcd2f6d6b57c8af9b495af0ac5a7b58b1170 (patch)
tree98a86e4d547751327639e14107ccf3eede4aecf9
parentb56064d7e37949396298deb9058b32457d12a733 (diff)
downloadeclipse.platform.text-012adcd2f6d6b57c8af9b495af0ac5a7b58b1170.tar.gz
eclipse.platform.text-012adcd2f6d6b57c8af9b495af0ac5a7b58b1170.tar.xz
eclipse.platform.text-012adcd2f6d6b57c8af9b495af0ac5a7b58b1170.zip
Optimize lambdasI20200123-1800
Uses method references if possible Removes unnecessary brackets Using the upcoming JDT cleanup from https://git.eclipse.org/r/#/c/148248/ Method references are faster in execution and shorter. Change-Id: I4b8edca1ad34eb1c8788e6729c9bb76f1eefb335 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningLineHeaderAnnotation.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java4
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/hyperlink/DefaultHyperlinkPresenter.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/AbstractRulerColumn.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java8
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/CompositeRuler.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java4
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRuler.java2
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/AbstractInlinedAnnotation.java2
-rw-r--r--org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java2
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/text/DecoratingFileSearchLabelProvider.java2
-rw-r--r--org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/PropertyEventDispatcher.java2
-rw-r--r--org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithIconAssociationOverride.java4
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RetargetTextEditorAction.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java4
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java2
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesView.java2
26 files changed, 32 insertions, 34 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningLineHeaderAnnotation.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningLineHeaderAnnotation.java
index 5108f7a09..b7188eae9 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningLineHeaderAnnotation.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningLineHeaderAnnotation.java
@@ -91,7 +91,7 @@ public class CodeMiningLineHeaderAnnotation extends LineHeaderAnnotation impleme
if (fResolvedMinings == null || fResolvedMinings.length == 0) {
return false;
}
- return Stream.of(fResolvedMinings).anyMatch(m -> CodeMiningManager.isValidMining(m));
+ return Stream.of(fResolvedMinings).anyMatch(CodeMiningManager::isValidMining);
}
@Override
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java
index 727d01141..4b950c468 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/codemining/CodeMiningManager.java
@@ -194,7 +194,7 @@ public class CodeMiningManager implements Runnable {
}))
.collect(Collectors.toList());
return CompletableFuture.allOf(com.toArray(new CompletableFuture[com.size()])).thenApply(
- v -> com.stream().map(CompletableFuture::join).flatMap(l -> l.stream()).collect(Collectors.toList()));
+ v -> com.stream().map(CompletableFuture::join).flatMap(java.util.Collection::stream).collect(Collectors.toList()));
}
/**
@@ -267,7 +267,7 @@ public class CodeMiningManager implements Runnable {
monitor.isCanceled();
fInlinedAnnotationSupport.updateAnnotations(currentAnnotations);
// redraw the existing codemining annotations since their content can change
- annotationsToRedraw.stream().forEach(ann -> ann.redraw());
+ annotationsToRedraw.stream().forEach(ICodeMiningAnnotation::redraw);
}
/**
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
index ceab558ab..0bf666e14 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
@@ -1377,7 +1377,7 @@ public final class RevisionPainter {
if (isConnected() && !fControl.isDisposed()) {
Display d= fControl.getDisplay();
if (d != null) {
- d.asyncExec(() -> redraw());
+ d.asyncExec(this::redraw);
}
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
index 0658f4fb8..00b0414f1 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/source/DiffPainter.java
@@ -358,7 +358,7 @@ public final class DiffPainter {
if (isConnected() && !fControl.isDisposed()) {
Display d= fControl.getDisplay();
if (d != null) {
- d.asyncExec(() -> redraw());
+ d.asyncExec(this::redraw);
}
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/hyperlink/DefaultHyperlinkPresenter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/hyperlink/DefaultHyperlinkPresenter.java
index 02e543b82..4edf9d887 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/hyperlink/DefaultHyperlinkPresenter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/hyperlink/DefaultHyperlinkPresenter.java
@@ -300,7 +300,7 @@ public class DefaultHyperlinkPresenter implements IHyperlinkPresenter, IHyperlin
StyledText widget= fTextViewer.getTextWidget();
if (widget != null && !widget.isDisposed()) {
- widget.getDisplay().asyncExec(() -> hideHyperlinks());
+ widget.getDisplay().asyncExec(this::hideHyperlinks);
}
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AbstractRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AbstractRulerColumn.java
index 7c0bd445c..f0b37e3cb 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AbstractRulerColumn.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AbstractRulerColumn.java
@@ -196,7 +196,7 @@ public abstract class AbstractRulerColumn implements IVerticalRulerColumn, IVert
fCanvas.setBackground(getDefaultBackground());
fCanvas.setFont(getFont());
- fCanvas.addPaintListener(event -> AbstractRulerColumn.this.paintControl(event));
+ fCanvas.addPaintListener(AbstractRulerColumn.this::paintControl);
fCanvas.addMouseListener(fMouseHandler);
fCanvas.addMouseMoveListener(fMouseHandler);
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java
index 324ada5ee..106a6fb1b 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java
@@ -184,7 +184,7 @@ public class AnnotationRulerColumn implements IVerticalRulerColumn, IVerticalRul
*/
private MouseListener fMouseListener;
- private Consumer<StyledText> lineHeightChangeHandler= (t) -> postRedraw();
+ private Consumer<StyledText> lineHeightChangeHandler= t -> postRedraw();
private ITextListener fLineListener = new ITextListener() {
private int previousLineCount = -1;
@@ -322,9 +322,9 @@ public class AnnotationRulerColumn implements IVerticalRulerColumn, IVerticalRul
};
fCanvas.addMouseListener(fMouseListener);
- fCanvas.addMouseMoveListener(e -> handleMouseMove(e));
+ fCanvas.addMouseMoveListener(this::handleMouseMove);
- fCanvas.addMouseWheelListener(e -> handleMouseScrolled(e));
+ fCanvas.addMouseWheelListener(this::handleMouseScrolled);
if (fCachedTextViewer != null) {
VisibleLinesTracker.track(fCachedTextViewer, lineHeightChangeHandler);
@@ -820,7 +820,7 @@ public class AnnotationRulerColumn implements IVerticalRulerColumn, IVerticalRul
if (fCanvas != null && !fCanvas.isDisposed()) {
Display d= fCanvas.getDisplay();
if (d != null) {
- d.asyncExec(() -> redraw());
+ d.asyncExec(this::redraw);
}
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java
index 991c3d284..94ff48fb9 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ChangeRulerColumn.java
@@ -422,7 +422,7 @@ public final class ChangeRulerColumn implements IChangeRulerColumn, IRevisionRul
if (fCanvas != null && !fCanvas.isDisposed()) {
Display d= fCanvas.getDisplay();
if (d != null) {
- d.asyncExec(() -> redraw());
+ d.asyncExec(this::redraw);
}
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/CompositeRuler.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/CompositeRuler.java
index 0ac7a8364..253281181 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/CompositeRuler.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/CompositeRuler.java
@@ -637,7 +637,7 @@ public class CompositeRuler implements IVerticalRuler, IVerticalRulerExtension,
if (fComposite != null && !fComposite.isDisposed()) {
Display d= fComposite.getDisplay();
if (d != null) {
- d.asyncExec(() -> immediateUpdate());
+ d.asyncExec(this::immediateUpdate);
}
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
index 1e2098486..b46c7c6b0 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java
@@ -419,7 +419,7 @@ public class LineNumberRulerColumn implements IVerticalRulerColumn {
*
* @since 3.13
*/
- private Consumer<StyledText> lineHeightChangeHandler= (t) -> postRedraw();
+ private Consumer<StyledText> lineHeightChangeHandler= t -> postRedraw();
/**
* Constructs a new vertical ruler column.
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java
index 3544a55ab..14693a304 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java
@@ -604,9 +604,9 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler {
}
});
- fCanvas.addMouseMoveListener(event -> handleMouseMove(event));
+ fCanvas.addMouseMoveListener(this::handleMouseMove);
- fCanvas.addMouseWheelListener(e -> handleMouseScrolled(e));
+ fCanvas.addMouseWheelListener(this::handleMouseScrolled);
if (fTextViewer != null) {
fTextViewer.addTextListener(fInternalListener);
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRuler.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRuler.java
index d37753f04..c63e6a45c 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRuler.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRuler.java
@@ -450,7 +450,7 @@ public final class VerticalRuler implements IVerticalRuler, IVerticalRulerExtens
if (fCanvas != null && !fCanvas.isDisposed()) {
Display d= fCanvas.getDisplay();
if (d != null) {
- d.asyncExec(() -> redraw());
+ d.asyncExec(this::redraw);
}
}
}
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/AbstractInlinedAnnotation.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/AbstractInlinedAnnotation.java
index 5fd7a0c9a..2644080db 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/AbstractInlinedAnnotation.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/inlined/AbstractInlinedAnnotation.java
@@ -120,7 +120,7 @@ public abstract class AbstractInlinedAnnotation extends Annotation {
*/
public void redraw() {
StyledText text= getTextWidget();
- InlinedAnnotationSupport.runInUIThread(text, (t) -> {
+ InlinedAnnotationSupport.runInUIThread(text, t -> {
Position pos= getPosition();
int offset= pos.getOffset();
ISourceViewer viewer= getViewer();
diff --git a/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java b/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
index d5b28d11d..dce993d11 100644
--- a/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
+++ b/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
@@ -301,7 +301,7 @@ public abstract class AbstractTextSearchViewPage extends Page implements ISearch
fBatchedUpdates = new HashSet<>();
fBatchedClearAll= false;
- fListener = e -> handleSearchResultChanged(e);
+ fListener = this::handleSearchResultChanged;
fFilterActions= null;
fElementLimit= null;
}
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/DecoratingFileSearchLabelProvider.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/DecoratingFileSearchLabelProvider.java
index 46a538c93..530dd9b99 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/text/DecoratingFileSearchLabelProvider.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/text/DecoratingFileSearchLabelProvider.java
@@ -93,7 +93,7 @@ public class DecoratingFileSearchLabelProvider extends DecoratingStyledCellLabel
String property= event.getProperty();
if (property.equals(JFacePreferences.QUALIFIER_COLOR) || property.equals(JFacePreferences.COUNTER_COLOR) || property.equals(JFacePreferences.DECORATIONS_COLOR)
|| property.equals(HIGHLIGHT_BG_COLOR_NAME) || property.equals(IWorkbenchPreferenceConstants.USE_COLORED_LABELS)) {
- Display.getDefault().asyncExec(() -> refresh());
+ Display.getDefault().asyncExec(this::refresh);
}
}
diff --git a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
index bc3d86874..793f6dade 100644
--- a/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
+++ b/org.eclipse.text.quicksearch/src/org/eclipse/text/quicksearch/internal/ui/QuickSearchDialog.java
@@ -716,7 +716,7 @@ public class QuickSearchDialog extends SelectionStatusDialog {
contextMenuManager = new MenuManager();
contextMenuManager.setRemoveAllWhenShown(true);
- contextMenuManager.addMenuListener(manager -> fillContextMenu(manager));
+ contextMenuManager.addMenuListener(this::fillContextMenu);
final Table table = list.getTable();
Menu menu= contextMenuManager.createContextMenu(table);
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java
index 28ad62179..db32c1090 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/QuickDiffConfigurationBlock.java
@@ -402,7 +402,7 @@ class QuickDiffConfigurationBlock implements IPreferenceConfigurationBlock {
String label = fQuickDiffProvider[1];
fQuickDiffProviderCombo.add(label);
}
- fQuickDiffProviderCombo.getDisplay().asyncExec(() -> updateProviderList());
+ fQuickDiffProviderCombo.getDisplay().asyncExec(this::updateProviderList);
initializeFields();
}
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java
index 11f4c4c1f..c982cf56e 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/SelectResourcesDialog.java
@@ -241,7 +241,7 @@ class SelectResourcesDialog extends Dialog {
private void filterSelection() {
- final IFilter filter= resource -> hasAcceptedFileType(resource);
+ final IFilter filter= this::hasAcceptedFileType;
List<Object> list= fResourceGroup.getAllWhiteCheckedItems();
final IResource[] resources= list.toArray(new IResource[list.size()]);
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/PropertyEventDispatcher.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/PropertyEventDispatcher.java
index d096f2d69..f0267ea89 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/PropertyEventDispatcher.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/PropertyEventDispatcher.java
@@ -28,7 +28,7 @@ public final class PropertyEventDispatcher {
private final Map<Object, Object> fHandlerMap= new HashMap<>();
private final Map<Object, Object> fReverseMap= new HashMap<>();
private final IPreferenceStore fStore;
- private final IPropertyChangeListener fListener= event -> firePropertyChange(event);
+ private final IPropertyChangeListener fListener= this::firePropertyChange;
public PropertyEventDispatcher(IPreferenceStore store) {
Assert.isLegal(store != null);
fStore= store;
diff --git a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithIconAssociationOverride.java b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithIconAssociationOverride.java
index 033d52311..37136e44d 100644
--- a/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithIconAssociationOverride.java
+++ b/org.eclipse.ui.genericeditor/src/org/eclipse/ui/internal/genericeditor/GenericEditorWithIconAssociationOverride.java
@@ -41,9 +41,7 @@ public class GenericEditorWithIconAssociationOverride implements IEditorAssociat
@Override
public IEditorDescriptor[] overrideEditors(String fileName, IContentType contentType,
IEditorDescriptor[] editorDescriptors) {
- return Arrays.stream(editorDescriptors).map(descriptor -> {
- return getEditorDescriptorForFile(descriptor, fileName);
- }).toArray(size -> new IEditorDescriptor[size]);
+ return Arrays.stream(editorDescriptors).map(descriptor -> getEditorDescriptorForFile(descriptor, fileName)).toArray(size -> new IEditorDescriptor[size]);
}
@Override
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index 6ace776d3..ed3d77f07 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -972,7 +972,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
* http://dev.eclipse.org/bugs/show_bug.cgi?id=11731
* Will be removed when SWT has solved the problem.
*/
- window.getShell().getDisplay().asyncExec(() -> handleActivation());
+ window.getShell().getDisplay().asyncExec(this::handleActivation);
}
}
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java
index ccc5e44ff..6d4a5322c 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java
@@ -70,7 +70,7 @@ public class InfoForm {
fForegroundColor= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
fSeparatorColor= new Color(display, 152, 170, 203);
- fPropertyChangeListener = event -> handlePropertyChange(event);
+ fPropertyChangeListener = this::handlePropertyChange;
JFaceResources.getFontRegistry().addListener(fPropertyChangeListener);
fScrolledComposite= new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RetargetTextEditorAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RetargetTextEditorAction.java
index 66e1d1386..d388e1f0f 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RetargetTextEditorAction.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/RetargetTextEditorAction.java
@@ -45,7 +45,7 @@ public final class RetargetTextEditorAction extends ResourceAction {
*/
private HelpListener fLocalHelpListener;
/** The listener to pick up changes of the target action. */
- private IPropertyChangeListener fListener= event -> update(event);
+ private IPropertyChangeListener fListener= this::update;
/**
* Creates a new action. The action configures its initial visual
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
index 9e0deea45..9be5cf36e 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/AbstractTemplatesPage.java
@@ -502,7 +502,7 @@ public abstract class AbstractTemplatesPage extends Page implements ITemplatesPa
int sashSize= fPreferenceStore.getInt(SASH_SIZE_PREF_ID);
fControl.setWeights(new int[] { sashSize, 100 - sashSize });
- fTemplateChangeListener = event -> getShell().getDisplay().asyncExec(() -> refresh());
+ fTemplateChangeListener = event -> getShell().getDisplay().asyncExec(this::refresh);
getTemplatePreferenceStore().addPropertyChangeListener(fTemplateChangeListener);
updateContextTypes(getEditorContextTypeIds());
}
@@ -1111,7 +1111,7 @@ public abstract class AbstractTemplatesPage extends Page implements ITemplatesPa
private void hookContextMenu() {
MenuManager menuMgr= new MenuManager(POPUP_MENU_ID);
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(manager -> fillContextMenu(manager));
+ menuMgr.addMenuListener(this::fillContextMenu);
fContextMenu= menuMgr.createContextMenu(fTreeViewer.getControl());
fTreeViewer.getControl().setMenu(fContextMenu);
getSite().registerContextMenu(POPUP_MENU_ID, menuMgr, fTreeViewer);
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
index 6b2e08d73..5db91d566 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java
@@ -586,7 +586,7 @@ public abstract class TemplatePreferencePage extends PreferencePage implements I
// create context menu
MenuManager manager= new MenuManager(null, null);
manager.setRemoveAllWhenShown(true);
- manager.addMenuListener(mgr -> fillContextMenu(mgr));
+ manager.addMenuListener(this::fillContextMenu);
StyledText text= fPatternEditor.getTextWidget();
Menu menu= manager.createContextMenu(text);
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesView.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesView.java
index 3c7a1c3ff..d7a9c8b0f 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesView.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatesView.java
@@ -171,7 +171,7 @@ public final class TemplatesView extends PageBookView {
@Override
public <T> T getAdapter(Class<T> key) {
if (key == IContributedContentsView.class) {
- return key.cast((IContributedContentsView) () -> getCurrentContributingPart());
+ return key.cast((IContributedContentsView) this::getCurrentContributingPart);
}
return super.getAdapter(key);
}

Back to the top