]> source.dussan.org Git - jgit.git/commitdiff
Remove deprecated LocalDiskRepositoryTestCase#create(boolean,boolean) 39/1200239/2
authorMatthias Sohn <matthias.sohn@sap.com>
Fri, 30 Aug 2024 14:32:30 +0000 (16:32 +0200)
committerLuca Milanesio <luca.milanesio@gmail.com>
Tue, 3 Sep 2024 09:44:26 +0000 (09:44 +0000)
Change-Id: I9eff2d405b5302753ff2ec1d0eab431bdba69fe0

org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryCacheTest.java

index 407290a39971493b3778ed3a89ba40b12e8fdd5f..98f69ed31c02f0df2d691290280f222ffb63d41e 100644 (file)
@@ -422,32 +422,11 @@ public abstract class LocalDiskRepositoryTestCase {
         */
        protected FileRepository createRepository(boolean bare)
                        throws IOException {
-               return createRepository(bare, false /* auto close */);
-       }
-
-       /**
-        * Creates a new empty repository.
-        *
-        * @param bare
-        *            true to create a bare repository; false to make a repository
-        *            within its working directory
-        * @param autoClose
-        *            auto close the repository in {@link #tearDown()}
-        * @return the newly created repository, opened for access
-        * @throws IOException
-        *             the repository could not be created in the temporary area
-        * @deprecated use {@link #createRepository(boolean)} instead
-        */
-       @Deprecated
-       public FileRepository createRepository(boolean bare, boolean autoClose)
-                       throws IOException {
                File gitdir = createUniqueTestGitDir(bare);
                FileRepository db = new FileRepository(gitdir);
                assertFalse(gitdir.exists());
                db.create(bare);
-               if (autoClose) {
-                       addRepoToClose(db);
-               }
+               addRepoToClose(db);
                return db;
        }
 
index cec69c49981b133fa3fce99286f7b03f5e602364..2a6551787fff3261fcd7e982a255429544eb261b 100644 (file)
@@ -159,8 +159,8 @@ public class RepositoryCacheTest extends RepositoryTestCase {
        @Test
        public void testRepositoryUsageCountWithRegisteredRepository()
                        throws IOException {
-               @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
-               Repository repo = createRepository(false, false);
+               @SuppressWarnings("resource") // We are testing the close() method
+               Repository repo = createRepository(false);
                assertEquals(1, repo.useCnt.get());
                RepositoryCache.register(repo);
                assertEquals(1, repo.useCnt.get());
@@ -207,10 +207,8 @@ public class RepositoryCacheTest extends RepositoryTestCase {
 
        @Test
        public void testRepositoryUnregisteringWhenExpired() throws Exception {
-               @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
-               Repository repoA = createRepository(true, false);
-               @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
-               Repository repoB = createRepository(true, false);
+               Repository repoA = createRepository(true);
+               Repository repoB = createRepository(true);
                Repository repoC = createBareRepository();
                RepositoryCache.register(repoA);
                RepositoryCache.register(repoB);
@@ -243,8 +241,7 @@ public class RepositoryCacheTest extends RepositoryTestCase {
 
        @Test
        public void testReconfigure() throws InterruptedException, IOException {
-               @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
-               Repository repo = createRepository(false, false);
+               Repository repo = createRepository(false);
                RepositoryCache.register(repo);
                assertTrue(RepositoryCache.isCached(repo));
                repo.close();