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.ui.test/src/org/eclipse/egit/ui/test
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.ui.test/src/org/eclipse/egit/ui/test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputFactoryTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/DiffStyleRangeFormatterTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/RepositoryCommitTest.java5
5 files changed, 5 insertions, 20 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputFactoryTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputFactoryTest.java
index 795efb2c5..0b6af5679 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputFactoryTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputFactoryTest.java
@@ -51,12 +51,9 @@ public class CommitEditorInputFactoryTest extends LocalRepositoryTestCase {
.lookupRepository(repoFile);
assertNotNull(repository);
- RevWalk walk = new RevWalk(repository);
- try {
+ try (RevWalk walk = new RevWalk(repository)) {
commit = walk.parseCommit(repository.resolve(Constants.HEAD));
assertNotNull(commit);
- } finally {
- walk.release();
}
memento = XMLMemento.createWriteRoot("test");
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputTest.java
index 07ffc754d..a898f1206 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputTest.java
@@ -45,12 +45,9 @@ public class CommitEditorInputTest extends LocalRepositoryTestCase {
.lookupRepository(repoFile);
assertNotNull(repository);
- RevWalk walk = new RevWalk(repository);
- try {
+ try (RevWalk walk = new RevWalk(repository)) {
commit = walk.parseCommit(repository.resolve(Constants.HEAD));
assertNotNull(commit);
- } finally {
- walk.release();
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
index dd8264d99..5a17851b5 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorTest.java
@@ -56,13 +56,10 @@ public class CommitEditorTest extends LocalRepositoryTestCase {
.lookupRepository(repoFile);
assertNotNull(repository);
- RevWalk walk = new RevWalk(repository);
- try {
+ try (RevWalk walk = new RevWalk(repository)) {
commit = walk.parseCommit(repository.resolve(Constants.HEAD));
assertNotNull(commit);
walk.parseBody(commit.getParent(0));
- } finally {
- walk.release();
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/DiffStyleRangeFormatterTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/DiffStyleRangeFormatterTest.java
index 57f509378..a1f7b5616 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/DiffStyleRangeFormatterTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/DiffStyleRangeFormatterTest.java
@@ -45,13 +45,10 @@ public class DiffStyleRangeFormatterTest extends LocalRepositoryTestCase {
.lookupRepository(repoFile);
assertNotNull(repository);
- RevWalk walk = new RevWalk(repository);
- try {
+ try (RevWalk walk = new RevWalk(repository)) {
commit = walk.parseCommit(repository.resolve(Constants.HEAD));
assertNotNull(commit);
walk.parseBody(commit.getParent(0));
- } finally {
- walk.release();
}
}
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/RepositoryCommitTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/RepositoryCommitTest.java
index e89682581..dbe23cba0 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/RepositoryCommitTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/RepositoryCommitTest.java
@@ -46,12 +46,9 @@ public class RepositoryCommitTest extends LocalRepositoryTestCase {
.lookupRepository(repoFile);
assertNotNull(repository);
- RevWalk walk = new RevWalk(repository);
- try {
+ try (RevWalk walk = new RevWalk(repository)) {
commit = walk.parseCommit(repository.resolve(Constants.HEAD));
assertNotNull(commit);
- } finally {
- walk.release();
}
}

Back to the top