From f81a0be408f74f160d646360efac2b68f5ae94a1 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Thu, 15 Dec 2016 23:57:50 +0300 Subject: [PATCH] [vcs-log] minor: lambdify, use method reference --- .../intellij/vcs/log/ui/tables/GraphTableModel.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java index 70eaf4853573..f044e5ac1dd4 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/tables/GraphTableModel.java @@ -67,12 +67,7 @@ public class GraphTableModel extends AbstractTableModel { public int getRowOfCommit(@NotNull final Hash hash, @NotNull VirtualFile root) { final int commitIndex = myLogData.getCommitIndex(hash, root); - return ContainerUtil.indexOf(VcsLogUtil.getVisibleCommits(myDataPack.getVisibleGraph()), new Condition() { - @Override - public boolean value(Integer integer) { - return integer == commitIndex; - } - }); + return ContainerUtil.indexOf(VcsLogUtil.getVisibleCommits(myDataPack.getVisibleGraph()), (Condition)i -> i == commitIndex); } public int getRowOfCommitByPartOfHash(@NotNull String partialHash) { @@ -110,7 +105,8 @@ public class GraphTableModel extends AbstractTableModel { case ROOT_COLUMN: return getRoot(rowIndex); case COMMIT_COLUMN: - return new GraphCommitCell(data.getSubject(), getRefsAtRow(rowIndex), myDataPack.getVisibleGraph().getRowInfo(rowIndex).getPrintElements()); + return new GraphCommitCell(data.getSubject(), getRefsAtRow(rowIndex), + myDataPack.getVisibleGraph().getRowInfo(rowIndex).getPrintElements()); case AUTHOR_COLUMN: String authorString = VcsUserUtil.getShortPresentation(data.getAuthor()); return authorString + (VcsUserUtil.isSamePerson(data.getAuthor(), data.getCommitter()) ? "" : "*"); @@ -217,6 +213,6 @@ public class GraphTableModel extends AbstractTableModel { @NotNull public List convertToCommitIds(@NotNull List rows) { - return ContainerUtil.map(rows, (NotNullFunction)row -> getIdAtRow(row)); + return ContainerUtil.map(rows, (NotNullFunction)this::getIdAtRow); } }