Skip to content

Commit 6d40679

Browse files
authored
Merge pull request #48567 from geoand/#48215
Properly set `typeOfHandler` field of `RouteBuildItem`
2 parents cfc475e + 93319a7 commit 6d40679

File tree

1 file changed

+18
-4
lines changed
  • extensions/vertx-http/deployment-spi/src/main/java/io/quarkus/vertx/http/deployment/spi

1 file changed

+18
-4
lines changed

extensions/vertx-http/deployment-spi/src/main/java/io/quarkus/vertx/http/deployment/spi/RouteBuildItem.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,15 @@ public enum RouteType {
8181

8282
private final Handler<RoutingContext> handler;
8383

84-
private final HandlerType typeOfHandler = HandlerType.NORMAL;
84+
private final HandlerType typeOfHandler;
8585

8686
private final boolean displayOnNotFoundPage;
8787
private final String notFoundPageTitle;
8888

8989
private final String routeConfigKey;
9090

9191
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
92+
@Deprecated(since = "3.25", forRemoval = true)
9293
public RouteBuildItem(RouteType typeOfRoute, String path, Consumer<Route> customizer,
9394
boolean isManagement,
9495
Handler<RoutingContext> handler,
@@ -97,6 +98,7 @@ public RouteBuildItem(RouteType typeOfRoute, String path, Consumer<Route> custom
9798
String routeConfigKey, OptionalInt order) {
9899
this.order = order;
99100
this.typeOfRoute = typeOfRoute;
101+
this.typeOfHandler = HandlerType.NORMAL;
100102
this.path = path;
101103
this.handler = handler;
102104
this.displayOnNotFoundPage = displayOnNotFoundPage;
@@ -106,6 +108,20 @@ public RouteBuildItem(RouteType typeOfRoute, String path, Consumer<Route> custom
106108
this.isManagement = isManagement;
107109
}
108110

111+
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
112+
private RouteBuildItem(Builder builder) {
113+
this.order = builder.order;
114+
this.typeOfRoute = builder.typeOfRoute;
115+
this.typeOfHandler = builder.typeOfHandler;
116+
this.path = builder.path;
117+
this.handler = builder.handler;
118+
this.displayOnNotFoundPage = builder.displayOnNotFoundPage;
119+
this.notFoundPageTitle = builder.notFoundPageTitle;
120+
this.routeConfigKey = builder.routeConfigKey;
121+
this.customizer = builder.customizer;
122+
this.isManagement = builder.isManagement;
123+
}
124+
109125
public RouteType getTypeOfRoute() {
110126
return typeOfRoute;
111127
}
@@ -391,9 +407,7 @@ public RouteBuildItem build() {
391407
throw new IllegalArgumentException("The route handler must be set");
392408
}
393409

394-
return new RouteBuildItem(typeOfRoute, path, customizer, isManagement, handler, displayOnNotFoundPage,
395-
notFoundPageTitle,
396-
routeConfigKey, order);
410+
return new RouteBuildItem(this);
397411
}
398412
}
399413

0 commit comments

Comments
 (0)