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
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')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchDialogTest.java5
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchQueryTest.java5
-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
7 files changed, 7 insertions, 28 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchDialogTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchDialogTest.java
index 5ddb45d367..bf02276399 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchDialogTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchDialogTest.java
@@ -55,13 +55,10 @@ public class CommitSearchDialogTest extends LocalRepositoryTestCase {
Activator.getDefault().getRepositoryUtil()
.addConfiguredRepository(repository.getDirectory());
- 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/search/CommitSearchQueryTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchQueryTest.java
index 1ff895c153..93b6e183f1 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchQueryTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/search/CommitSearchQueryTest.java
@@ -50,12 +50,9 @@ public class CommitSearchQueryTest 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/CommitEditorInputFactoryTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/commit/CommitEditorInputFactoryTest.java
index 795efb2c54..0b6af56794 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 07ffc754dd..a898f12066 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 dd8264d994..5a17851b53 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 57f5093787..a1f7b5616e 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 e89682581a..dbe23cba0a 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