summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit.http/src/org/eclipse
diff options
context:
space:
mode:
authorCarsten Hammer <carsten.hammer@t-online.de>2019-04-06 20:13:26 +0200
committerCarsten Hammer <carsten.hammer@t-online.de>2019-05-16 02:58:43 -0400
commit84fc5c908d78a5a78f7d00226e066e56b9c6cafe (patch)
tree2c53d3af07da8bae0fd34ca0fe3dc9dfd215aa44 /org.eclipse.jgit.junit.http/src/org/eclipse
parentc33d2bfb9f5d0f407bb736fafe2fa8ff93309e93 (diff)
downloadjgit-84fc5c908d78a5a78f7d00226e066e56b9c6cafe.tar.gz
jgit-84fc5c908d78a5a78f7d00226e066e56b9c6cafe.zip
Convert to lambda or member reference
Convert anonymous inner classes to lambda expressions or member references Bug: 545856 CQ: 19537 Change-Id: I621431c178e8b99316314602f7c66c9a36f9ae98 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit.http/src/org/eclipse')
-rw-r--r--org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java
index 245b510fe1..7c78330828 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/SimpleHttpServer.java
@@ -54,8 +54,6 @@ import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.http.server.GitServlet;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.URIish;
-import org.eclipse.jgit.transport.resolver.RepositoryResolver;
-import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException;
/**
* Simple http server for testing http access to Git repositories.
@@ -136,17 +134,12 @@ public class SimpleHttpServer {
private ServletContextHandler smart(String path) {
GitServlet gs = new GitServlet();
- gs.setRepositoryResolver(new RepositoryResolver<HttpServletRequest>() {
- @Override
- public Repository open(HttpServletRequest req, String name)
- throws RepositoryNotFoundException,
- ServiceNotEnabledException {
- if (!name.equals(nameOf(db)))
- throw new RepositoryNotFoundException(name);
-
- db.incrementOpen();
- return db;
+ gs.setRepositoryResolver((HttpServletRequest req, String name) -> {
+ if (!name.equals(nameOf(db))) {
+ throw new RepositoryNotFoundException(name);
}
+ db.incrementOpen();
+ return db;
});
ServletContextHandler ctx = server.addContext(path);