Browse Source

Add type argumente to some raw reclaration

Change-Id: Ief195fb5c55f75172f0428fdac8c8874292ae566
stable-2.3
Robin Rosenberg 12 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
04bc9b3ddc
  1. 2
      org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java
  2. 2
      org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java
  3. 2
      org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java
  4. 5
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java
  5. 5
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java
  6. 5
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java
  7. 5
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java
  8. 24
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java
  9. 4
      org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
  10. 5
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
  11. 5
      org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
  12. 16
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java
  13. 4
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java

2
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitServlet.java

@ -182,7 +182,7 @@ public class GitServlet extends MetaServlet {
return config.getInitParameter(name);
}
public Enumeration getInitParameterNames() {
public Enumeration<String> getInitParameterNames() {
return config.getInitParameterNames();
}

2
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/NoParameterFilterConfig.java

@ -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;

2
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/UrlPipeline.java

@ -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;

5
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultReceivePackFactoryTest.java

@ -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);

5
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DefaultUploadPackFactoryTest.java

@ -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);

5
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java

@ -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));

5
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java

@ -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));

24
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/FileResolverTest.java

@ -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);

4
org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java

@ -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.

5
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java

@ -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);

5
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java

@ -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);
}

16
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PackParserTest.java

@ -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);

4
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackAdvertiseRefsHookTest.java

@ -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);

Loading…
Cancel
Save