Skip to content

Commit 90e0907

Browse files
committed
modify generators
1 parent 52de85f commit 90e0907

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

http-generator-core/src/main/java/io/avaje/http/generator/core/Util.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ static String combinePath(String beanPath, String webMethodPath) {
7272
}
7373

7474
public static String shortName(String fullType) {
75+
return shortName(fullType, false);
76+
}
77+
78+
public static String shortName(String fullType, boolean role) {
7579
int p = fullType.lastIndexOf('.');
7680
if (p == -1) {
7781
return fullType;
78-
} else if (fullType.startsWith("java")
79-
|| fullType.contains("io.javalin.security.RouteRole")
80-
|| fullType.contains("io.avaje.jex.Role")) {
82+
} else if (fullType.startsWith("java")||role) {
8183
return fullType.substring(p + 1);
8284
} else {
8385
var result = "";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void write(boolean requestScoped) {
7878
if (i > 0) {
7979
writer.append(", ");
8080
}
81-
writer.append(Util.shortName(roles.get(i)));
81+
writer.append(Util.shortName(roles.get(i), true));
8282
}
8383
}
8484
writer.append(");").eol().eol();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void write(boolean requestScoped) {
8181
if (i > 0) {
8282
writer.append(", ");
8383
}
84-
writer.append(Util.shortName(roles.get(i)));
84+
writer.append(Util.shortName(roles.get(i), true));
8585
}
8686
}
8787
writer.append(");").eol().eol();

0 commit comments

Comments
 (0)