mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[file-history] stop exposing RowInfoImpl class
This commit is contained in:
+7
-7
@@ -63,11 +63,15 @@ public class VisibleGraphImpl<CommitId> implements VisibleGraph<CommitId> {
|
||||
@NotNull
|
||||
@Override
|
||||
public RowInfo<CommitId> getRowInfo(final int visibleRow) {
|
||||
final int nodeId = myGraphController.getCompiledGraph().getNodeId(visibleRow);
|
||||
final int nodeId = getNodeId(visibleRow);
|
||||
assert nodeId >= 0; // todo remake for all id
|
||||
return new RowInfoImpl(nodeId, visibleRow);
|
||||
}
|
||||
|
||||
public int getNodeId(int visibleRow) {
|
||||
return myGraphController.getCompiledGraph().getNodeId(visibleRow);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Integer getVisibleRowIndex(@NotNull CommitId commitId) {
|
||||
@@ -113,7 +117,7 @@ public class VisibleGraphImpl<CommitId> implements VisibleGraph<CommitId> {
|
||||
@Nullable
|
||||
private Integer convertToNodeId(@Nullable Integer nodeIndex) {
|
||||
if (nodeIndex == null) return null;
|
||||
return myGraphController.getCompiledGraph().getNodeId(nodeIndex);
|
||||
return getNodeId(nodeIndex);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -259,7 +263,7 @@ public class VisibleGraphImpl<CommitId> implements VisibleGraph<CommitId> {
|
||||
}
|
||||
}
|
||||
|
||||
public class RowInfoImpl implements RowInfo<CommitId> {
|
||||
private class RowInfoImpl implements RowInfo<CommitId> {
|
||||
private final int myNodeId;
|
||||
private final int myVisibleRow;
|
||||
|
||||
@@ -268,10 +272,6 @@ public class VisibleGraphImpl<CommitId> implements VisibleGraph<CommitId> {
|
||||
myVisibleRow = visibleRow;
|
||||
}
|
||||
|
||||
public int getNodeId() {
|
||||
return myNodeId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public CommitId getCommit() {
|
||||
|
||||
@@ -213,24 +213,22 @@ class FileHistoryFilterer extends VcsLogFilterer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enterNode(int node, int previousNode) {
|
||||
public void enterNode(int currentNode, int previousNode) {
|
||||
FilePath previousPath = myPaths.peek();
|
||||
RowInfo<Integer> currentRowInfo = myVisibleGraph.getRowInfo(node);
|
||||
int currentCommit = currentRowInfo.getCommit();
|
||||
int currentNodeId = ((VisibleGraphImpl.RowInfoImpl)currentRowInfo).getNodeId();
|
||||
int currentNodeId = myVisibleGraph.getNodeId(currentNode);
|
||||
int currentCommit = myPermanentCommitsInfo.getCommitId(currentNodeId);
|
||||
|
||||
if (previousNode == DfsUtil.NextNode.NODE_NOT_FOUND) {
|
||||
myPathsForCommits.put(currentCommit, previousPath);
|
||||
myPaths.push(previousPath);
|
||||
}
|
||||
else {
|
||||
FilePath currentPath;
|
||||
RowInfo<Integer> previousRowInfo = myVisibleGraph.getRowInfo(previousNode);
|
||||
int previousCommit = previousRowInfo.getCommit();
|
||||
int previousNodeId = ((VisibleGraphImpl.RowInfoImpl)previousRowInfo).getNodeId();
|
||||
int previousNodeId = myVisibleGraph.getNodeId(previousNode);
|
||||
int previousCommit = myPermanentCommitsInfo.getCommitId(previousNodeId);
|
||||
|
||||
FilePath currentPath;
|
||||
// checking which node is the parent and which is the child
|
||||
if (myLinearVisibleGraph.getNodes(node, LiteLinearGraph.NodeFilter.DOWN).contains(previousNode)) {
|
||||
if (myLinearVisibleGraph.getNodes(currentNode, LiteLinearGraph.NodeFilter.DOWN).contains(previousNode)) {
|
||||
// since in reality there is no edge between the nodes, but the whole path, we need to know, which parent is affected by this path
|
||||
int parentIndex = BfsUtil.getCorrespondingParent(myPermanentLinearGraph, currentNodeId, previousNodeId, myVisibilityBuffer);
|
||||
currentPath = myNamesData.getPathInChildRevision(currentCommit, myPermanentCommitsInfo.getCommitId(parentIndex), previousPath);
|
||||
|
||||
Reference in New Issue
Block a user