]> source.dussan.org Git - jgit.git/commitdiff
Suppress "The allocated object is never used" warning in tests 20/64320/2
authorDavid Pursehouse <david.pursehouse@sonymobile.com>
Thu, 14 Jan 2016 08:01:50 +0000 (17:01 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 19 Jan 2016 16:27:45 +0000 (17:27 +0100)
Change-Id: Ibb405e0b36ce5a2cb30268a7de31ab2bd079ad80
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheEntryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0003_BasicTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0001_PersonIdentTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/SideBandOutputStreamTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/URIishTest.java

index dc7181aece7240eccd4c99f07093c14502d9ed9d..05fa0079045821d06bc54becda9d2e6a7aebb7ea 100644 (file)
@@ -69,6 +69,7 @@ public class DirCacheEntryTest {
                assertFalse(isValidPath("a\u0000b"));
        }
 
+       @SuppressWarnings("unused")
        private static boolean isValidPath(String path) {
                try {
                        new DirCacheEntry(path);
@@ -78,6 +79,7 @@ public class DirCacheEntryTest {
                }
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void testCreate_ByStringPath() {
                assertEquals("a", new DirCacheEntry("a").getPathString());
@@ -91,6 +93,7 @@ public class DirCacheEntryTest {
                }
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void testCreate_ByStringPathAndStage() {
                DirCacheEntry e;
index 280d6040cc6844b36a117a1edcc652c63149c57d..2d72d2373b27a63c9172d1d0d05f9719ba44ff35 100644 (file)
@@ -72,6 +72,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase {
                                .findGitDir(d).getGitDir());
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void emptyRepositoryFormatVersion() throws Exception {
                Repository r = createWorkRepository();
@@ -83,6 +84,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase {
                new FileRepository(r.getDirectory());
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void invalidRepositoryFormatVersion() throws Exception {
                Repository r = createWorkRepository();
@@ -99,6 +101,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase {
                }
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void unknownRepositoryFormatVersion() throws Exception {
                Repository r = createWorkRepository();
index 5670a9634d7c8d53584326636b51bf3b68e4a0b3..a92ff8d04ecf95f7670ded9ab1548616922c1d69 100644 (file)
@@ -364,6 +364,7 @@ public class T0003_BasicTest extends SampleDataRepositoryTestCase {
                assertNotSame(db.getConfig(), db2.getConfig());
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void test008_FailOnWrongVersion() throws IOException {
                final File cfg = new File(db.getDirectory(), Constants.CONFIG);
index 315c495606e3ce1e1d05c98310447b37c2bcfd78..1515a07ac49101f43d5f5b8d0537896e77596233 100644 (file)
@@ -75,11 +75,13 @@ public class T0001_PersonIdentTest {
                                p.toExternalString());
        }
 
+       @SuppressWarnings("unused")
        @Test(expected = IllegalArgumentException.class)
        public void nullForNameShouldThrowIllegalArgumentException() {
                new PersonIdent(null, "author@example.com");
        }
 
+       @SuppressWarnings("unused")
        @Test(expected = IllegalArgumentException.class)
        public void nullForEmailShouldThrowIllegalArgumentException() {
                new PersonIdent("A U Thor", null);
index e9ae1909ea2468a8514d90790c7cfd65d0742fbc..3661677cd9636d26c40611a6ad19b409aee5f445 100644 (file)
@@ -195,6 +195,7 @@ public class SideBandOutputStreamTest {
                assertEquals(1, flushCnt[0]);
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void testConstructor_RejectsBadChannel() {
                try {
@@ -220,6 +221,7 @@ public class SideBandOutputStreamTest {
                }
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void testConstructor_RejectsBadBufferSize() {
                try {
index 76eb18afdf1aa12cee387a652e27c8ddbb937580..0fda72cf9d215ff846e928a3b5c5ce04b9eb4224 100644 (file)
@@ -64,6 +64,7 @@ public class URIishTest {
 
        private static final String GIT_SCHEME = "git://";
 
+       @SuppressWarnings("unused")
        @Test
        public void shouldRaiseErrorOnEmptyURI() throws Exception {
                try {
@@ -74,6 +75,7 @@ public class URIishTest {
                }
        }
 
+       @SuppressWarnings("unused")
        @Test
        public void shouldRaiseErrorOnNullURI() throws Exception {
                try {