Skip to content

Commit ff6b270

Browse files
committed
Update ControllerReader.java
1 parent dc2f003 commit ff6b270

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ private List<Element> initInterfaces() {
8484
List<Element> interfaces = new ArrayList<>();
8585
for (TypeMirror anInterface : beanType.getInterfaces()) {
8686
final Element ifaceElement = ctx.asElement(anInterface);
87-
if ((ifaceElement.getAnnotation(Path.class) != null) || !ifaceElement.getAnnotation(Controller.class).value().isBlank()) {
87+
if (!ifaceElement.getAnnotation(Controller.class).value().isBlank()
88+
|| ifaceElement.getAnnotation(Path.class) != null) {
8889
interfaces.add(ifaceElement);
8990
}
9091
}
@@ -256,7 +257,7 @@ public List<MethodReader> methods() {
256257

257258
public String path() {
258259

259-
return Optional.ofNullable(findAnnotation(Controller.class))
260+
return Optional.of(findAnnotation(Controller.class))
260261
.map(Controller::value)
261262
.filter(not(String::isBlank))
262263
.or(() -> Optional.ofNullable(findAnnotation(Path.class)).map(Path::value))

0 commit comments

Comments
 (0)