Skip to content

Commit 8ff3090

Browse files
committed
netty: clean up netty source code
1 parent 360bbcc commit 8ff3090

File tree

11 files changed

+35
-1038
lines changed

11 files changed

+35
-1038
lines changed

jooby/src/main/java/io/jooby/internal/Chi.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
package io.jooby.internal;
77

88
import java.util.Arrays;
9+
import java.util.HashMap;
910
import java.util.Map;
1011
import java.util.Objects;
11-
import java.util.concurrent.ConcurrentHashMap;
1212
import java.util.regex.Pattern;
1313
import java.util.stream.Collectors;
1414
import java.util.stream.Stream;
@@ -485,7 +485,7 @@ public StaticRoute get(String path) {
485485
}
486486

487487
private static class StaticMapN implements StaticMap {
488-
private final Map<String, StaticRoute> paths = new ConcurrentHashMap<>(10);
488+
private final Map<String, StaticRoute> paths = new HashMap<>(10);
489489

490490
public StaticMapN(StaticMap6 staticMap, String path, StaticRoute staticRoute) {
491491
put(staticMap.pattern1, staticMap.route1);
@@ -549,7 +549,7 @@ public void clear() {
549549
}
550550

551551
private static class MultipleMethodMatcher implements MethodMatcher {
552-
private final Map<String, StaticRouterMatch> methods = new ConcurrentHashMap<>();
552+
private final Map<String, StaticRouterMatch> methods = new HashMap<>();
553553

554554
public MultipleMethodMatcher(SingleMethodMatcher matcher) {
555555
methods.put(matcher.method, matcher.route);
@@ -890,7 +890,7 @@ void setEndpoint(String method, Route route) {
890890
Node n = this;
891891
// Set the handler for the method type on the node
892892
if (n.endpoints == null) {
893-
n.endpoints = new ConcurrentHashMap<>();
893+
n.endpoints = new HashMap<>();
894894
}
895895

896896
// if ((method & mSTUB) == mSTUB) {

jooby/src/test/java/io/jooby/Issue3607.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.junit.jupiter.api.Test;
1111

1212
import io.jooby.output.Output;
13+
import io.jooby.output.OutputFactory;
1314

1415
public class Issue3607 {
1516

@@ -24,6 +25,7 @@ public Output render(Context ctx, ModelAndView<?> modelAndView) throws Exception
2425
@Test
2526
public void shouldNotGenerateEmptyFlashMap() throws Exception {
2627
var ctx = mock(Context.class);
28+
when(ctx.getOutputFactory()).thenReturn(OutputFactory.create(false));
2729

2830
var templateEngine = new TemplateEngineImpl();
2931
templateEngine.encode(ctx, ModelAndView.map("index.html"));

jooby/src/test/java/io/jooby/internal/ChiTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ public void routeOverride() {
3333
assertEquals(bar, result.route());
3434
}
3535

36+
@Test
37+
public void staticMap6() {
38+
Chi router = new Chi();
39+
router.insert(route("GET", "/1", stringHandler("1")));
40+
router.insert(route("GET", "/2", stringHandler("2")));
41+
router.insert(route("GET", "/3", stringHandler("3")));
42+
router.insert(route("GET", "/4", stringHandler("4")));
43+
router.insert(route("GET", "/5", stringHandler("5")));
44+
router.insert(route("GET", "/6", stringHandler("6")));
45+
}
46+
3647
@Test
3748
public void routeCase() {
3849
Chi router = new Chi();

modules/jooby-netty/src/main/java/io/jooby/internal/netty/AssembledFullHttpResponse.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

modules/jooby-netty/src/main/java/io/jooby/internal/netty/AssembledHttpResponse.java

Lines changed: 0 additions & 165 deletions
This file was deleted.

0 commit comments

Comments
 (0)