Skip to content

Commit

Permalink
Only initialize Krazo if we are sure that the app is an MVC app
Browse files Browse the repository at this point in the history
  • Loading branch information
chkal committed Apr 3, 2021
1 parent fe9bed0 commit d04726f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2019 Eclipse Krazo committers and contributors
* Copyright (c) 2018, 2021 Eclipse Krazo committers and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -80,7 +80,7 @@ private static boolean isMvcApplication(ServletContext servletContext) {
Set<Class<?>> controllersFound = servletContext != null
? (Set<Class<?>>) servletContext.getAttribute(KrazoContainerInitializer.CONTROLLER_CLASSES)
: null;
boolean enable = controllersFound == null || !controllersFound.isEmpty();
boolean enable = controllersFound != null && !controllersFound.isEmpty();

log.log(Level.FINE, "Is Eclipse Krazo application detected: {0}", enable);
return enable;
Expand Down

0 comments on commit d04726f

Please sign in to comment.