Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2019-11-24 17:33:07 +0000
committerMatthias Sohn2019-12-22 22:35:32 +0000
commit3514dc0efd4b876bf8772cbcc4566adf655de201 (patch)
tree24a0493417c32135b8cf43f1c467992238efd3df
parentd1b31c4f601f6aee33d03adf5c61c4918f020b9c (diff)
downloadegit-3514dc0efd4b876bf8772cbcc4566adf655de201.tar.gz
egit-3514dc0efd4b876bf8772cbcc4566adf655de201.tar.xz
egit-3514dc0efd4b876bf8772cbcc4566adf655de201.zip
Use method references where possible
Convert lambda expressions to method references. Conversion has been done entirely by JDT quick assist, search has been done via Sonarlint. Change-Id: I7e2310d2bc4b15cf772017be35a47135d7069368 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/CachingRepository.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/ProjectTrackerPreferenceHelper.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorOutlinePage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/MultiPageEditorContentOutlinePage.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractConfigureRemoteDialog.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkSourceViewer.java12
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RefFilterHelper.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogView.java4
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchResultsPage.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/MultiViewerSelectionProvider.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java4
23 files changed, 37 insertions, 40 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/CachingRepository.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/CachingRepository.java
index 6586ba9e7..79295ccb3 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/CachingRepository.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/CachingRepository.java
@@ -30,7 +30,7 @@ import org.eclipse.jgit.storage.file.FileBasedConfig;
class CachingRepository extends FileRepository {
private static final ThreadLocal<Map<File, CachedConfig>> CACHED_CONFIG = ThreadLocal
- .withInitial(() -> new HashMap<>());
+ .withInitial(HashMap::new);
/**
* @param options
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
index daad240ce..0c77212e2 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/op/BranchOperation.java
@@ -203,7 +203,7 @@ public class BranchOperation implements IEGitOperation {
throws CoreException {
IProject[] refreshProjects = results.entrySet().stream()
.map(this::getAffectedProjects)
- .flatMap(arr -> Stream.of(arr)).distinct()
+ .flatMap(Stream::of).distinct()
.toArray(IProject[]::new);
ProjectUtil.refreshValidProjects(refreshProjects, delete,
monitor);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
index 61aa9b1c5..7d00a3687 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/BranchProjectTracker.java
@@ -100,7 +100,7 @@ class BranchProjectTracker {
public ProjectTrackerMemento snapshot() {
ProjectTrackerMemento memento = new ProjectTrackerMemento();
Stream.of(repositories).map(this::takeSnapshot).filter(Objects::nonNull)
- .forEach(x -> memento.addSnapshot(x));
+ .forEach(memento::addSnapshot);
return memento;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/ProjectTrackerPreferenceHelper.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/ProjectTrackerPreferenceHelper.java
index 5726f520d..303bc901a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/ProjectTrackerPreferenceHelper.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/branch/ProjectTrackerPreferenceHelper.java
@@ -126,7 +126,7 @@ class ProjectTrackerPreferenceHelper {
return Collections.emptyList();
}
List<String> projectPaths = Stream.of(children)
- .map(child -> child.getTextData())
+ .map(IMemento::getTextData)
.filter(x -> !StringUtils.isEmptyOrNull(x))
.collect(Collectors.toList());
return projectPaths;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorOutlinePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorOutlinePage.java
index b570a2ff2..4257154c6 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorOutlinePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/DiffEditorOutlinePage.java
@@ -76,7 +76,7 @@ public class DiffEditorOutlinePage extends NestedContentOutlinePage {
viewer.setLabelProvider(new DiffLabelProvider());
viewer.addDoubleClickListener(
event -> openFolder(event.getSelection()));
- viewer.addOpenListener(event -> fireOpenEvent(event));
+ viewer.addOpenListener(this::fireOpenEvent);
if (input != null) {
viewer.setInput(input);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/MultiPageEditorContentOutlinePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/MultiPageEditorContentOutlinePage.java
index 26c1ec4f3..584ba2e74 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/MultiPageEditorContentOutlinePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/MultiPageEditorContentOutlinePage.java
@@ -53,8 +53,7 @@ public class MultiPageEditorContentOutlinePage extends ContentOutlinePage {
private final MultiPageEditorPart editorPart;
- private final ISelectionChangedListener globalSelectionListener = //
- event -> fireSelectionChangedEvent(event);
+ private final ISelectionChangedListener globalSelectionListener = this::fireSelectionChangedEvent;
private final CopyOnWriteArrayList<ISelectionChangedListener> selectionListeners = new CopyOnWriteArrayList<>();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
index fa19de2ea..bef0f7f68 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/command/RevertHandler.java
@@ -61,7 +61,8 @@ public class RevertHandler extends CommitCommandHandler {
}
List<RevCommit> commits = repoCommits.stream()
- .map(c -> c.getRevCommit()).collect(Collectors.toList());
+ .map(IRepositoryCommit::getRevCommit)
+ .collect(Collectors.toList());
try {
if (!CommitUtil.areCommitsInCurrentBranch(commits, repo)) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractConfigureRemoteDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractConfigureRemoteDialog.java
index d5fd2fca2..591511213 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractConfigureRemoteDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractConfigureRemoteDialog.java
@@ -347,11 +347,11 @@ public abstract class AbstractConfigureRemoteDialog
}
};
IAction deleteRefSpecAction = ActionUtils.createGlobalAction(
- ActionFactory.DELETE, () -> doDeleteRefSpecs());
+ ActionFactory.DELETE, this::doDeleteRefSpecs);
IAction copyRefSpecAction = ActionUtils
- .createGlobalAction(ActionFactory.COPY, () -> doCopy());
+ .createGlobalAction(ActionFactory.COPY, this::doCopy);
IAction pasteRefSpecAction = ActionUtils
- .createGlobalAction(ActionFactory.PASTE, () -> doPaste());
+ .createGlobalAction(ActionFactory.PASTE, this::doPaste);
IAction selectAllRefSpecsAction = ActionUtils.createGlobalAction(
ActionFactory.SELECT_ALL,
() -> {
@@ -539,7 +539,7 @@ public abstract class AbstractConfigureRemoteDialog
case DRY_RUN:
try {
new ProgressMonitorDialog(getShell()).run(true, true,
- (monitor) -> dryRun(monitor));
+ this::dryRun);
} catch (InvocationTargetException e) {
Activator.showError(e.getMessage(), e);
} catch (InterruptedException e1) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkSourceViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkSourceViewer.java
index 741dde1fa..3646a9513 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkSourceViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/HyperlinkSourceViewer.java
@@ -119,12 +119,10 @@ public class HyperlinkSourceViewer extends ProjectionViewer {
super(parent, verticalRuler, overviewRuler, showAnnotationsOverview,
styles);
setColors();
- editorPropertyChangeListener = event -> handleEditorPreferencesChange(
- event);
+ editorPropertyChangeListener = this::handleEditorPreferencesChange;
EditorsUI.getPreferenceStore()
.addPropertyChangeListener(editorPropertyChangeListener);
- jFacePropertyChangeListener = event -> handleJFacePreferencesChange(
- event);
+ jFacePropertyChangeListener = this::handleJFacePreferencesChange;
JFacePreferences.getPreferenceStore()
.addPropertyChangeListener(jFacePropertyChangeListener);
}
@@ -140,7 +138,7 @@ public class HyperlinkSourceViewer extends ProjectionViewer {
String property = event.getProperty();
if (preferenceKeysForEnablement.contains(property)) {
resetHyperlinkDetectors();
- async(() -> refresh());
+ async(this::refresh);
} else if (preferenceKeysForActivation.contains(property)) {
resetHyperlinkDetectors();
}
@@ -231,7 +229,7 @@ public class HyperlinkSourceViewer extends ProjectionViewer {
case AbstractTextEditor.PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT:
case AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND:
case AbstractTextEditor.PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT:
- async(() -> setColors());
+ async(this::setColors);
break;
default:
break;
@@ -248,7 +246,7 @@ public class HyperlinkSourceViewer extends ProjectionViewer {
*/
protected void handleJFacePreferencesChange(PropertyChangeEvent event) {
if (JFacePreferences.HYPERLINK_COLOR.equals(event.getProperty())) {
- async(() -> invalidateTextPresentation());
+ async(this::invalidateTextPresentation);
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
index d490c4cbc..4419f59b9 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/SpellcheckableMessageArea.java
@@ -507,7 +507,7 @@ public class SpellcheckableMessageArea extends Composite {
List<AnnotationPreference> annotationPreferences = new MarkerAnnotationPreferences()
.getAnnotationPreferences();
annotationPreferences.iterator()
- .forEachRemaining(p -> support.setAnnotationPreference(p));
+ .forEachRemaining(support::setAnnotationPreference);
support.install(EditorsUI.getPreferenceStore());
return support;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java
index 6dcf3cfe2..7a2066781 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchDestinationPage.java
@@ -96,7 +96,7 @@ public class FetchDestinationPage extends WizardPage {
GridDataFactory.fillDefaults().grab(true, false).applyTo(
destinationText);
UIUtils.addRefContentProposalToText(sourceText, repository,
- () -> getRemoteRefs(), true);
+ this::getRemoteRefs, true);
force = new Button(main, SWT.CHECK);
force.setText(UIText.FetchDestinationPage_ForceCheckbox);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java
index 6668b63f8..f4e053338 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/FetchSourcePage.java
@@ -91,7 +91,7 @@ public class FetchSourcePage extends WizardPage {
});
GridDataFactory.fillDefaults().grab(true, false).applyTo(sourceText);
UIUtils.addRefContentProposalToText(sourceText, repository,
- () -> getRemoteRefs(), true);
+ this::getRemoteRefs, true);
checkPage();
setControl(main);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
index 3f7b65393..dd7123c7c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitFileDiffViewer.java
@@ -361,7 +361,7 @@ public class CommitFileDiffViewer extends TableViewer {
copy.setEnabled(true);
if ((rawTable.getStyle() & SWT.MULTI) != 0) {
selectAll = ActionUtils.createGlobalAction(ActionFactory.SELECT_ALL,
- () -> doSelectAll());
+ this::doSelectAll);
selectAll.setEnabled(true);
ActionUtils.setGlobalActions(rawTable, copy, selectAll);
mgr.add(selectAll);
@@ -911,7 +911,7 @@ public class CommitFileDiffViewer extends TableViewer {
FileDiff first = diffs.iterator().next();
Repository repository = first.getRepository();
String revision = first.getCommit().getName();
- List<String> paths = diffs.stream().map(d -> d.getNewPath())
+ List<String> paths = diffs.stream().map(FileDiff::getNewPath)
.collect(Collectors.toList());
return new DiscardChangesOperation(repository, paths, revision);
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
index c6ff9f136..dd02cad27 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java
@@ -277,7 +277,7 @@ class CommitGraphTable {
});
copy = ActionUtils.createGlobalAction(ActionFactory.COPY,
- () -> doCopy());
+ this::doCopy);
copy.setText(UIText.CommitGraphTable_CopyCommitIdLabel);
copy.setImageDescriptor(UIIcons.ELCL16_ID);
table.setUseHashlookup(true);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
index 412131f76..ca0a4ae4c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitSelectionDialog.java
@@ -235,7 +235,8 @@ public class CommitSelectionDialog extends TitleAreaDialog {
if (monitor.isCanceled()) {
throw new InterruptedException();
}
- getShell().getDisplay().asyncExec(() -> updateUi());
+ getShell().getDisplay().asyncExec(
+ CommitSelectionDialog.this::updateUi);
} catch (IOException e) {
throw new InvocationTargetException(e);
} finally {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
index e62be85e2..c480f2f09 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
@@ -307,12 +307,12 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
if (IAction.ENABLED.equals(e.getProperty())) {
boolean previousEnablement = isEnabled();
childEnablement = FilterAction.this.actions.stream()
- .anyMatch(act -> act.isEnabled());
+ .anyMatch(IAction::isEnabled);
boolean currentEnablement = isEnabled();
if (currentEnablement != previousEnablement) {
IAction currentChild = currentEnablement
? FilterAction.this.actions.stream()
- .filter(act -> act.isChecked())
+ .filter(IAction::isChecked)
.findFirst().orElse(null)
: null;
if (currentChild == null) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RefFilterHelper.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RefFilterHelper.java
index 913178dac..6617b748c 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RefFilterHelper.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/RefFilterHelper.java
@@ -430,7 +430,7 @@ public class RefFilterHelper {
RefDatabase db = this.repository.getRefDatabase();
Set<Ref> result = new LinkedHashSet<>();
Set<RefFilter> selectedFilters = getRefFilters().stream()
- .filter(f -> f.isSelected())
+ .filter(RefFilter::isSelected)
.collect(Collectors.toCollection(LinkedHashSet::new));
for (Ref ref : db.getRefs()) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogView.java
index 0f369640e..db37776db 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/reflog/ReflogView.java
@@ -426,7 +426,7 @@ public class ReflogView extends ViewPart implements RefsChangedListener, IShowIn
selectionChangedListener, site);
site.setSelectionProvider(new RepositorySelectionProvider(
- refLogTreeViewer, () -> getRepository()));
+ refLogTreeViewer, this::getRepository));
addRefsChangedListener = org.eclipse.egit.core.Activator.getDefault()
.getRepositoryCache().getGlobalListenerList()
@@ -436,7 +436,7 @@ public class ReflogView extends ViewPart implements RefsChangedListener, IShowIn
IToolBarManager toolbar = getViewSite().getActionBars()
.getToolBarManager();
switchRepositoriesAction = new RepositoryToolbarAction(false,
- () -> getRepository(),
+ this::getRepository,
repo -> reactOnSelection(new StructuredSelection(repo)));
toolbar.add(switchRepositoriesAction);
getViewSite().getActionBars().updateActionBars();
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java
index d792f04a6..9fc503981 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/DropAdapterAssistant.java
@@ -160,7 +160,7 @@ public class DropAdapterAssistant extends CommonDropAdapterAssistant {
private boolean onlyRepositoryNodesSelected(ISelection selection) {
if (selection instanceof IStructuredSelection) {
return ((List<?>) ((IStructuredSelection) selection).toList())
- .stream().allMatch(e -> isRegularRepository(e));
+ .stream().allMatch(this::isRegularRepository);
}
return false;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java
index fd4cadd6a..289692f1a 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryTreeNodeDecorator.java
@@ -469,7 +469,7 @@ public class RepositoryTreeNodeDecorator extends GitDecorator
}
Set<String> modified = data.getModified();
return data.getSubmodules().stream()
- .anyMatch(s -> modified.contains(s));
+ .anyMatch(modified::contains);
}
@Override
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchResultsPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchResultsPage.java
index 1353a4a89..5e817a0e2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchResultsPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/search/CommitSearchResultsPage.java
@@ -82,7 +82,7 @@ public class CommitSearchResultsPage extends AbstractTextSearchViewPage {
for (Object inputElement : getInput().getElements()) {
RepositoryCommit commit = (RepositoryCommit) inputElement;
repos.computeIfAbsent(commit.getRepository(),
- r -> new RepositoryMatch(r)).addCommit(commit);
+ RepositoryMatch::new).addCommit(commit);
}
return repos.values().toArray();
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/MultiViewerSelectionProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/MultiViewerSelectionProvider.java
index d1c3f7bab..372c864d8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/MultiViewerSelectionProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/selection/MultiViewerSelectionProvider.java
@@ -38,11 +38,9 @@ public class MultiViewerSelectionProvider extends AbstractSelectionProvider {
}
};
- private final ISelectionChangedListener selectionHook = event -> selectionChanged(
- event);
+ private final ISelectionChangedListener selectionHook = this::selectionChanged;
- private final ISelectionChangedListener postSelectionHook = event -> postSelectionChanged(
- event);
+ private final ISelectionChangedListener postSelectionHook = this::postSelectionChanged;
private Viewer currentViewer;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
index 209eb9a85..ba0c91a03 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java
@@ -1876,7 +1876,7 @@ public class StagingView extends ViewPart
StagingViewSearchThread searchThread = new StagingViewSearchThread(
StagingView.this);
filterText.getDisplay().timerExec(200,
- () -> searchThread.start());
+ searchThread::start);
});
return toolbarComposite;
}
@@ -2164,7 +2164,7 @@ public class StagingView extends ViewPart
}
}
});
- viewer.addOpenListener(event -> compareWith(event));
+ viewer.addOpenListener(this::compareWith);
viewer.setComparator(new StagingEntryComparator(!getSortCheckState(),
getPreferenceStore()
.getBoolean(UIPreferences.STAGING_VIEW_FILENAME_MODE)));

Back to the top