Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-08-14 10:14:14 -0400
committerThomas Wolf2018-08-25 06:41:21 -0400
commit4377af5af4c7a463e858123c306093c250258711 (patch)
tree7e0cb6401ce02c2c261f59209b70fe91a2e9ec55
parent1f69fad3e04670e5ab4d5a25ee8bb032c16beb1a (diff)
downloadegit-4377af5af4c7a463e858123c306093c250258711.tar.gz
egit-4377af5af4c7a463e858123c306093c250258711.tar.xz
egit-4377af5af4c7a463e858123c306093c250258711.zip
Replace PlotWalk usage by RevWalk
* replace PlotWalk by RevWalk * use try-with-resource to automatically call close() * remove call to dispose(), to be more symmetric with other instances and to avoid the remaining unfilteredCommit variable to become invalid Change-Id: Id39560715a5483e58ff3957416263b17d966505f Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Bug:537937
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java6
1 files changed, 1 insertions, 5 deletions
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 1561c5200e..0494aa7775 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
@@ -119,7 +119,6 @@ import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.revplot.PlotWalk;
import org.eclipse.jgit.revwalk.FollowFilter;
import org.eclipse.jgit.revwalk.RenameCallback;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -1447,8 +1446,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return;
}
commentViewer.setInput(c);
- final PlotWalk walk = new PlotWalk(input.getRepository());
- try {
+ try (RevWalk walk = new RevWalk(input.getRepository())) {
final RevCommit unfilteredCommit = walk.parseCommit(c);
for (RevCommit parent : unfilteredCommit.getParents())
walk.parseBody(parent);
@@ -1460,8 +1458,6 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
fileViewer.setInput(new FileDiffInput(input.getRepository(),
fileDiffWalker, c, fileViewerInterestingPaths,
input.getSingleFile() != null));
- } finally {
- walk.dispose();
}
}
});

Back to the top