Skip to content

Commit

Permalink
Skip user VaadinServlets without @WebServlet instead of NPE on `qua…
Browse files Browse the repository at this point in the history
…rkusBuild` (#77)

* fix: Skip user VaadinServlets without @WebServlet instead of NPE

Fixes: #76
Signed-off-by: Konstantin Gribov <[email protected]>

Co-authored-by: Soroosh Taefi <[email protected]>
  • Loading branch information
grossws and taefi authored Jun 27, 2022
1 parent a8ebedd commit 77d63fb
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@
import com.vaadin.quarkus.context.UIScopedContext;
import com.vaadin.quarkus.context.VaadinServiceScopedContext;
import com.vaadin.quarkus.context.VaadinSessionScopedContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class VaadinQuarkusProcessor {

private static final Logger LOG = LoggerFactory.getLogger(VaadinQuarkusProcessor.class);

private static final String FEATURE = "vaadin-quarkus";

private static final DotName ROUTE_ANNOTATION = DotName
Expand Down Expand Up @@ -227,6 +231,11 @@ private void registerUserServlets(
for (ClassInfo info : vaadinServlets) {
final AnnotationInstance webServletInstance = info.classAnnotation(
DotName.createSimple(WebServlet.class.getName()));
if (webServletInstance == null) {
LOG.warn("Found unexpected {} extends VaadinServlet without @WebServlet, skipping", info.name());
continue;
}

String servletName = Optional
.ofNullable(webServletInstance.value("name"))
.map(AnnotationValue::asString)
Expand Down

0 comments on commit 77d63fb

Please sign in to comment.