Compare commits

..

1 Commits

Author SHA1 Message Date
Gustavo Henrique Miranda a46e856257
Merge a5bd6e2c39 into 9c3a1126a7 2025-11-29 09:52:57 -03:00
2 changed files with 3 additions and 6 deletions

View File

@ -66,17 +66,14 @@ public class DelegateActionManager {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private ActionHandler instantiateHandler(Class<?> clazz) throws Exception { private ActionHandler instantiateHandler(Class<?> clazz) throws Exception {
if(!ActionHandler.class.isAssignableFrom(clazz)){
throw new IllegalArgumentException(
clazz.getName() + " is annotated with @Action but does not implement ActionHandler");
}
logger.debug("Attempting to instantiate handler: {}", clazz.getSimpleName()); logger.debug("Attempting to instantiate handler: {}", clazz.getSimpleName());
Constructor<?>[] constructors = clazz.getDeclaredConstructors(); Constructor<?>[] constructors = clazz.getDeclaredConstructors();
Constructor<?>[] constructors = clazz.getDeclaredConstructors();
// Sort constructors by parameter count (descending) to prefer DI constructors // Sort constructors by parameter count (descending) to prefer DI constructors
java.util.Arrays.sort(constructors, (c1, c2) -> java.util.Arrays.sort(constructors, (c1, c2) ->
Integer.compare(c2.getParameterCount(), c1.getParameterCount())); Integer.compare(c2.getParameterCount(), c1.getParameterCount()));