Skip to content

Commit 57dc796

Browse files
rbygraveSentryMan
andauthored
Generated $Route classes as final (#524)
These can be final right? Co-authored-by: Josiah Noel <32279667+SentryMan@users.noreply.github.com>
1 parent ab436b6 commit 57dc796

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void writeRoutes(List<ControllerMethodWriter> methods) {
123123
private void writeClassStart() {
124124
writer.append(AT_GENERATED).eol();
125125
writer.append(diAnnotation()).eol();
126-
writer.append("public class %s$Route implements HttpFeature {", shortName).eol().eol();
126+
writer.append("public final class %s$Route implements HttpFeature {", shortName).eol().eol();
127127

128128
var controllerName = "controller";
129129
var controllerType = shortName;

http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/ControllerWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private void writeClassStart() {
8484
writer.append(AT_GENERATED).eol();
8585
writer.append(diAnnotation()).eol();
8686
writer
87-
.append("public class ")
87+
.append("public final class ")
8888
.append(shortName)
8989
.append(javalin6 ? "$Route extends AvajeJavalinPlugin {" : "$Route implements Plugin {")
9090
.eol()

http-generator-jex/src/main/java/io/avaje/http/generator/jex/ControllerWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private void writeRouting(MethodReader method) {
8989
private void writeClassStart() {
9090
writer.append(AT_GENERATED).eol();
9191
writer.append(diAnnotation()).eol();
92-
writer.append("public class ").append(shortName).append("$Route implements Routing.HttpService {").eol().eol();
92+
writer.append("public final class ").append(shortName).append("$Route implements Routing.HttpService {").eol().eol();
9393

9494
String controllerName = "controller";
9595
String controllerType = shortName;

0 commit comments

Comments
 (0)