]> source.dussan.org Git - jgit.git/commitdiff
Add type argumente to some raw reclaration 56/9256/3
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Sat, 15 Dec 2012 10:41:32 +0000 (11:41 +0100)
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>
Thu, 27 Dec 2012 16:57:34 +0000 (11:57 -0500)
Change-Id: Ief195fb5c55f75172f0428fdac8c8874292ae566

13 files changed:
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java

index 11c3de39e4ceee05022814d96cca41410780b839..bca521025d8271af806c7232868aa31b5070d5b6 100644 (file)
@@ -182,7 +182,7 @@ public class GitServlet extends MetaServlet {
                                return config.getInitParameter(name);
                        }
 
-                       public Enumeration getInitParameterNames() {
+                       public Enumeration<String> getInitParameterNames() {
                                return config.getInitParameterNames();
                        }
 
index c7ca2b2898ad83eeba691c46be5cd2651012df6c..8dfcc4d14912f0ecf3de2d967cd0da6c322042c7 100644 (file)
@@ -63,7 +63,7 @@ final class NoParameterFilterConfig implements FilterConfig {
                return null;
        }
 
-       public Enumeration getInitParameterNames() {
+       public Enumeration<String> getInitParameterNames() {
                return new Enumeration<String>() {
                        public boolean hasMoreElements() {
                                return false;
index 53008deb11421ace3bb48214e88914fe5098a326..2d0b844072b9699df97a1318db632b882b654148 100644 (file)
@@ -125,7 +125,7 @@ abstract class UrlPipeline {
                                        return null;
                                }
 
-                               public Enumeration getInitParameterNames() {
+                               public Enumeration<String> getInitParameterNames() {
                                        return new Enumeration<String>() {
                                                public boolean hasMoreElements() {
                                                        return false;
index e35197ad420f1d9e323eb3616fe5ad56320782be..04f7c52f951d1296ec893a174530d500cc1de744 100644 (file)
@@ -50,6 +50,7 @@ import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.eclipse.jetty.server.Request;
@@ -68,7 +69,7 @@ import org.junit.Test;
 public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase {
        private Repository db;
 
-       private ReceivePackFactory factory;
+       private ReceivePackFactory<HttpServletRequest> factory;
 
        @Before
        public void setUp() throws Exception {
@@ -80,7 +81,7 @@ public class DefaultReceivePackFactoryTest extends LocalDiskRepositoryTestCase {
 
        @Test
        public void testDisabledSingleton() throws ServiceNotAuthorizedException {
-               factory = ReceivePackFactory.DISABLED;
+               factory = (ReceivePackFactory<HttpServletRequest>) ReceivePackFactory.DISABLED;
 
                try {
                        factory.create(new R(null, "localhost"), db);
index 38dc72fa3364505e824a0f0f7b402dd5fa925e7d..bc137036764531cbdf8dfc41bddde7f5e93e2c31 100644 (file)
@@ -49,6 +49,7 @@ import static org.junit.Assert.fail;
 
 import java.io.IOException;
 
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.eclipse.jetty.server.Request;
@@ -66,7 +67,7 @@ import org.junit.Test;
 public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase {
        private Repository db;
 
-       private UploadPackFactory factory;
+       private UploadPackFactory<HttpServletRequest> factory;
 
        @Before
        public void setUp() throws Exception {
@@ -78,7 +79,7 @@ public class DefaultUploadPackFactoryTest extends LocalDiskRepositoryTestCase {
 
        @Test
        public void testDisabledSingleton() throws ServiceNotAuthorizedException {
-               factory = UploadPackFactory.DISABLED;
+               factory = (UploadPackFactory<HttpServletRequest>) UploadPackFactory.DISABLED;
 
                try {
                        factory.create(new R(null, "localhost"), db);
index 5899dd41d24c598b5360688a03e4617c6e0b4b34..bb9f47022bdad68af0cc6bf4188ad33d5247e518 100644 (file)
@@ -70,6 +70,7 @@ import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.storage.file.FileRepository;
 import org.eclipse.jgit.transport.FetchConnection;
 import org.eclipse.jgit.transport.HttpTransport;
 import org.eclipse.jgit.transport.Transport;
@@ -91,7 +92,7 @@ public class DumbClientDumbServerTest extends HttpTestCase {
        public void setUp() throws Exception {
                super.setUp();
 
-               final TestRepository src = createTestRepository();
+               final TestRepository<FileRepository> src = createTestRepository();
                final File srcGit = src.getRepository().getDirectory();
                final URI base = srcGit.getParentFile().toURI();
 
@@ -198,7 +199,7 @@ public class DumbClientDumbServerTest extends HttpTestCase {
 
        @Test
        public void testInitialClone_Packed() throws Exception {
-               new TestRepository(remoteRepository).packAndPrune();
+               new TestRepository<Repository>(remoteRepository).packAndPrune();
 
                Repository dst = createBareRepository();
                assertFalse(dst.hasObject(A_txt));
index b81cca1ca4673bf678e07de51cc86475c44b5a1b..4ddfcc5ccfcbb835e251c2a6d0e8a6781f347030 100644 (file)
@@ -74,6 +74,7 @@ import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.revwalk.RevBlob;
 import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.storage.file.FileRepository;
 import org.eclipse.jgit.transport.FetchConnection;
 import org.eclipse.jgit.transport.HttpTransport;
 import org.eclipse.jgit.transport.Transport;
@@ -97,7 +98,7 @@ public class DumbClientSmartServerTest extends HttpTestCase {
        public void setUp() throws Exception {
                super.setUp();
 
-               final TestRepository src = createTestRepository();
+               final TestRepository<FileRepository> src = createTestRepository();
                final String srcName = src.getRepository().getDirectory().getName();
 
                ServletContextHandler app = server.addContext("/git");
@@ -217,7 +218,7 @@ public class DumbClientSmartServerTest extends HttpTestCase {
 
        @Test
        public void testInitialClone_Packed() throws Exception {
-               new TestRepository(remoteRepository).packAndPrune();
+               new TestRepository<Repository>(remoteRepository).packAndPrune();
 
                Repository dst = createBareRepository();
                assertFalse(dst.hasObject(A_txt));
index f2490988499ff8cda0c187d1c1d55ec9b8664b4a..cafb9590e1d15f536ae735cc33ebfbb93e7d3a4d 100644 (file)
@@ -56,6 +56,7 @@ import org.eclipse.jgit.errors.RepositoryNotFoundException;
 import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.transport.resolver.FileResolver;
+import org.eclipse.jgit.transport.resolver.RepositoryResolver;
 import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
 import org.eclipse.jgit.util.FileUtils;
 import org.junit.Test;
@@ -82,7 +83,8 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
 
        private void assertUnreasonable(String name)
                        throws ServiceNotEnabledException {
-               FileResolver r = new FileResolver(new File("."), false);
+               FileResolver<RepositoryResolver> r = new FileResolver<RepositoryResolver>(
+                               new File("."), false);
                try {
                        r.open(null, name);
                        fail("Opened unreasonable name \"" + name + "\"");
@@ -98,10 +100,13 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
                final String name = a.getDirectory().getName();
                final File base = a.getDirectory().getParentFile();
                final File export = new File(a.getDirectory(), "git-daemon-export-ok");
-               FileResolver resolver;
+               FileResolver<RepositoryResolver> resolver;
 
                assertFalse("no git-daemon-export-ok", export.exists());
-               resolver = new FileResolver(base, false /* require flag */);
+               resolver = new FileResolver<RepositoryResolver>(base, false /*
+                                                                                                                                        * require
+                                                                                                                                        * flag
+                                                                                                                                        */);
                try {
                        resolver.open(null, name);
                        fail("opened non-exported repository");
@@ -109,7 +114,10 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
                        assertEquals("Service not enabled", e.getMessage());
                }
 
-               resolver = new FileResolver(base, true /* export all */);
+               resolver = new FileResolver<RepositoryResolver>(base, true /*
+                                                                                                                                        * export
+                                                                                                                                        * all
+                                                                                                                                        */);
                try {
                        resolver.open(null, name).close();
                } catch (ServiceNotEnabledException e) {
@@ -117,7 +125,10 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
                }
 
                FileUtils.createNewFile(export);
-               resolver = new FileResolver(base, false /* require flag */);
+               resolver = new FileResolver<RepositoryResolver>(base, false /*
+                                                                                                                                        * require
+                                                                                                                                        * flag
+                                                                                                                                        */);
                try {
                        resolver.open(null, name).close();
                } catch (ServiceNotEnabledException e) {
@@ -131,7 +142,8 @@ public class FileResolverTest extends LocalDiskRepositoryTestCase {
                final Repository a = createBareRepository();
                final String name = a.getDirectory().getName() + "-not-a-git";
                final File base = a.getDirectory().getParentFile();
-               FileResolver resolver = new FileResolver(base, false);
+               FileResolver<RepositoryResolver> resolver = new FileResolver<RepositoryResolver>(
+                               base, false);
 
                try {
                        resolver.open(null, name);
index 2a39c9f39cbd1447dc0d1f192d9e9e38ffdd779f..4f0543aec13e22f49b4b19a374a9f54df143cea2 100644 (file)
@@ -320,7 +320,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
 
                // Create a new commit on the remote.
                //
-               b = new TestRepository(remoteRepository).branch(master);
+               b = new TestRepository<Repository>(remoteRepository).branch(master);
                RevCommit Z = b.commit().message("Z").create();
 
                // Now incrementally update.
@@ -386,7 +386,7 @@ public class SmartClientSmartServerTest extends HttpTestCase {
 
                // Create a new commit on the remote.
                //
-               b = new TestRepository(remoteRepository).branch(master);
+               b = new TestRepository<Repository>(remoteRepository).branch(master);
                RevCommit Z = b.commit().message("Z").create();
 
                // Now incrementally update.
index a183a1ce7322f5e5a55de9e1129a2206b7b47229..efdaa7bd70924bb32537392f2f21796b05560622 100644 (file)
@@ -54,6 +54,7 @@ import org.eclipse.jgit.dircache.DirCacheIterator;
 import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.eclipse.jgit.patch.FileHeader;
 import org.eclipse.jgit.patch.HunkHeader;
@@ -79,13 +80,13 @@ public class DiffFormatterTest extends RepositoryTestCase {
 
        private DiffFormatter df;
 
-       private TestRepository testDb;
+       private TestRepository<Repository> testDb;
 
        @Override
        @Before
        public void setUp() throws Exception {
                super.setUp();
-               testDb = new TestRepository(db);
+               testDb = new TestRepository<Repository>(db);
                df = new DiffFormatter(DisabledOutputStream.INSTANCE);
                df.setRepository(db);
                df.setAbbreviationLength(8);
index 70e45444ac7b83d139c60757998007822a1ed845..6b35a2bd3b2d27a696c8c74f9d99b73bdb49c633 100644 (file)
@@ -55,6 +55,7 @@ import org.eclipse.jgit.junit.TestRepository;
 import org.eclipse.jgit.lib.AbbreviatedObjectId;
 import org.eclipse.jgit.lib.FileMode;
 import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.lib.RepositoryTestCase;
 import org.junit.Before;
 import org.junit.Test;
@@ -67,13 +68,13 @@ public class RenameDetectorTest extends RepositoryTestCase {
 
        private RenameDetector rd;
 
-       private TestRepository testDb;
+       private TestRepository<Repository> testDb;
 
        @Override
        @Before
        public void setUp() throws Exception {
                super.setUp();
-               testDb = new TestRepository(db);
+               testDb = new TestRepository<Repository>(db);
                rd = new RenameDetector(db);
        }
 
index 9514aaa5ee3d3eec1dceb292fcbdfc0826c191b7..9cf01a98e58ad717be3fbc273fce79ece1b47ac7 100644 (file)
@@ -148,7 +148,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testTinyThinPack() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                RevBlob a = d.blob("a");
 
                TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@@ -186,7 +186,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testPackWithTrailingGarbage() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                RevBlob a = d.blob("a");
 
                TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@@ -213,7 +213,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testMaxObjectSizeFullBlob() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                final byte[] data = Constants.encode("0123456789");
                d.blob(data);
 
@@ -245,7 +245,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testMaxObjectSizeDeltaBlock() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                RevBlob a = d.blob("a");
 
                TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@@ -276,7 +276,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testMaxObjectSizeDeltaResultSize() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                RevBlob a = d.blob("0123456789");
 
                TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@@ -306,7 +306,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testNonMarkingInputStream() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                RevBlob a = d.blob("a");
 
                TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(1024);
@@ -344,7 +344,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testDataAfterPackFooterSingleRead() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                RevBlob a = d.blob("a");
 
                TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(32*1024);
@@ -402,7 +402,7 @@ public class PackParserTest extends RepositoryTestCase {
 
        @Test
        public void testDataAfterPackFooterSplitHeaderRead() throws Exception {
-               TestRepository d = new TestRepository(db);
+               TestRepository d = new TestRepository<Repository>(db);
                final byte[] data = Constants.encode("a");
                RevBlob b = d.blob(data);
 
index 5f17394e2e7c8dda80471d827e242e4c04bbb7f9..9e52bcaa5f95736d1d7cf38ab1b036e1c16f4dcc 100644 (file)
@@ -108,7 +108,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas
 
                // Fill dst with a some common history.
                //
-               TestRepository d = new TestRepository(dst);
+               TestRepository<Repository> d = new TestRepository<Repository>(dst);
                a = d.blob("a");
                A = d.commit(d.tree(d.file("a", a)));
                B = d.commit().parent(A).create();
@@ -201,7 +201,7 @@ public class ReceivePackAdvertiseRefsHookTest extends LocalDiskRepositoryTestCas
 
                // Now use b but in a different commit than what is hidden.
                //
-               TestRepository s = new TestRepository(src);
+               TestRepository<Repository> s = new TestRepository<Repository>(src);
                RevCommit N = s.commit().parent(B).add("q", b).create();
                s.update(R_MASTER, N);