mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] use getRequiredData instead of null checks
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.intellij.vcs.log.ui.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -35,12 +36,9 @@ public class GoToHashOrRefAction extends DumbAwareAction {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
Project project = e.getProject();
|
||||
final VcsLog log = e.getData(VcsLogDataKeys.VCS_LOG);
|
||||
final VcsLogUiImpl logUi = (VcsLogUiImpl)e.getData(VcsLogDataKeys.VCS_LOG_UI);
|
||||
if (project == null || log == null || logUi == null) {
|
||||
return;
|
||||
}
|
||||
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
|
||||
final VcsLog log = e.getRequiredData(VcsLogDataKeys.VCS_LOG);
|
||||
final VcsLogUiImpl logUi = (VcsLogUiImpl)e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
|
||||
|
||||
Set<VirtualFile> visibleRoots = VcsLogUtil.getVisibleRoots(logUi);
|
||||
Collection<VcsRef> visibleBranches = VcsLogUtil.getVisibleBranches(log, visibleRoots);
|
||||
|
||||
Reference in New Issue
Block a user