Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2015-03-01 23:28:25 +0000
committerMatthias Sohn2015-03-02 10:14:10 +0000
commitff636289869f4569c6b99d0a7b96ab83e4f26582 (patch)
treed8420e2653b58fcb99c317e81ece7069bbab06bb /org.eclipse.egit.mylyn.ui/src/org
parent434f1dbf12e8394f061b9fe654c776ea6e1b5d97 (diff)
downloadegit-ff636289869f4569c6b99d0a7b96ab83e4f26582.tar.gz
egit-ff636289869f4569c6b99d0a7b96ab83e4f26582.tar.xz
egit-ff636289869f4569c6b99d0a7b96ab83e4f26582.zip
Replace deprecated RevWalk.close()
Use try-with-resources statements instead. Change-Id: I05ba3440a5c1b55afb2d759088c25ad22bee24e6 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.mylyn.ui/src/org')
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java
index 34fec85d1d..b5746b52ae 100644
--- a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java
+++ b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/CommitHyperlinkDetector.java
@@ -123,9 +123,7 @@ public class CommitHyperlinkDetector extends AbstractHyperlinkDetector {
}
private RevCommit getCommit(Repository repository) throws IOException {
- RevWalk revWalk = null;
- try {
- revWalk = new RevWalk(repository);
+ try (RevWalk revWalk = new RevWalk(repository)) {
return revWalk.parseCommit(ObjectId.fromString(objectId));
} catch (MissingObjectException e) {
// ignore
@@ -133,11 +131,7 @@ public class CommitHyperlinkDetector extends AbstractHyperlinkDetector {
} catch (IncorrectObjectTypeException e) {
// ignore
return null;
- } finally {
- if (revWalk != null)
- revWalk.release();
}
-
}
@Override

Back to the top