Hello,
just updated to jooby 3.x from 2.x and now, we're getting a NPE during build in a very special case.
We have controllers that are potentially empty from a routing perspective (aka. it doesn't contain any route-related method) but they inherit from another class (which is also routing-irrelevant). In short, we have FooController extends AbstractBarController with 0 routing-related method.
In this case, the following code runs:
|
registry.computeIfAbsent(currentType, key -> new MvcRouter(key, registry.get(superType))); |
This however assumes that the super type is actually a valid controller since it tries to read it from the registry without any explicit check. This results in a NPE inside the constructor of the MvcRouter.
I think the registry should also be checked if it contains the superType.
Hello,
just updated to jooby 3.x from 2.x and now, we're getting a NPE during build in a very special case.
We have controllers that are potentially empty from a routing perspective (aka. it doesn't contain any route-related method) but they inherit from another class (which is also routing-irrelevant). In short, we have
FooController extends AbstractBarControllerwith 0 routing-related method.In this case, the following code runs:
jooby/modules/jooby-apt/src/main/java/io/jooby/apt/JoobyProcessor.java
Line 296 in dff85ce
This however assumes that the super type is actually a valid controller since it tries to read it from the
registrywithout any explicit check. This results in a NPE inside the constructor of theMvcRouter.I think the registry should also be checked if it contains the
superType.