summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-05-14 16:25:43 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2024-05-14 16:35:41 +0200
commitbca1f4d6582ceb1f50171de315536b318eeb0fae (patch)
treee48515b1b5c19b6f3781cc6fa95923a94d8ebf3b /org.eclipse.jgit.test
parent7dd522403a51577312b5cfa65f0c5566a49a94eb (diff)
downloadjgit-bca1f4d6582ceb1f50171de315536b318eeb0fae.tar.gz
jgit-bca1f4d6582ceb1f50171de315536b318eeb0fae.zip
Fix warning "Redundant specification of type arguments <Object>"
Use a lambda to fix this and make the code easier to read. Change-Id: I082ffb2073f86d21deb4b51a24e53de9371b765e
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java16
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java16
2 files changed, 6 insertions, 26 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java
index c47e591445..0ba8926a7f 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/AtomicPushTest.java
@@ -25,10 +25,6 @@ import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
import org.eclipse.jgit.junit.TestRepository;
import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.transport.resolver.ReceivePackFactory;
-import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException;
-import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -46,16 +42,8 @@ public class AtomicPushTest {
public void setUp() throws Exception {
server = newRepo("server");
client = newRepo("client");
- testProtocol = new TestProtocol<>(
- null,
- new ReceivePackFactory<Object>() {
- @Override
- public ReceivePack create(Object req, Repository db)
- throws ServiceNotEnabledException,
- ServiceNotAuthorizedException {
- return new ReceivePack(db);
- }
- });
+ testProtocol = new TestProtocol<>(null,
+ (req, db) -> new ReceivePack(db));
uri = testProtocol.register(ctx, server);
try (TestRepository<?> clientRepo = new TestRepository<>(client)) {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java
index 2711762640..a5507c8f81 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackReachabilityTest.java
@@ -27,9 +27,6 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevBlob;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.transport.UploadPack.RequestPolicy;
-import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException;
-import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
-import org.eclipse.jgit.transport.resolver.UploadPackFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -264,15 +261,10 @@ public class UploadPackReachabilityTest {
}
private static TestProtocol<Object> generateReachableCommitUploadPackProtocol() {
- return new TestProtocol<>(new UploadPackFactory<Object>() {
- @Override
- public UploadPack create(Object req, Repository db)
- throws ServiceNotEnabledException,
- ServiceNotAuthorizedException {
- UploadPack up = new UploadPack(db);
- up.setRequestPolicy(RequestPolicy.REACHABLE_COMMIT);
- return up;
- }
+ return new TestProtocol<>((req, db) -> {
+ UploadPack up = new UploadPack(db);
+ up.setRequestPolicy(RequestPolicy.REACHABLE_COMMIT);
+ return up;
}, null);
}
}