From 98f7c0abea61db1f7a19747be4adecc5e0c003a5 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Thu, 28 Apr 2016 18:56:45 +0300 Subject: [PATCH] [vcs-log] use lambdas and method references in VcsProjectLog --- .../intellij/vcs/log/impl/VcsProjectLog.java | 32 ++++--------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java index d0c71ff86d9b..32529d0adb6a 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java @@ -90,14 +90,11 @@ public class VcsProjectLog { @CalledInAny private void recreateLog() { - ApplicationManager.getApplication().invokeLater(new Runnable() { - @Override - public void run() { - disposeLog(); + ApplicationManager.getApplication().invokeLater(() -> { + disposeLog(); - if (hasDvcsRoots()) { - createLog(); - } + if (hasDvcsRoots()) { + createLog(); } }); } @@ -116,12 +113,7 @@ public class VcsProjectLog { myMessageBus.syncPublisher(VCS_PROJECT_LOG_CHANGED).logCreated(); if (PostponableLogRefresher.keepUpToDate()) { - new HeavyAwareExecutor(myProject).execute(new Runnable() { - @Override - public void run() { - logManager.scheduleInitialization(); - } - }); + new HeavyAwareExecutor(myProject).execute(logManager::scheduleInitialization); } } @@ -179,19 +171,9 @@ public class VcsProjectLog { VcsProjectLog projectLog = getInstance(project); MessageBusConnection connection = project.getMessageBus().connect(project); - connection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, new VcsListener() { - @Override - public void directoryMappingChanged() { - projectLog.recreateLog(); - } - }); + connection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, projectLog::recreateLog); if (projectLog.hasDvcsRoots()) { - ApplicationManager.getApplication().invokeLater(new Runnable() { - @Override - public void run() { - projectLog.createLog(); - } - }); + ApplicationManager.getApplication().invokeLater(projectLog::createLog); } } }