diff --git a/extensions/hibernate-validator/deployment/src/main/java/io/quarkus/hibernate/validator/deployment/HibernateValidatorProcessor.java b/extensions/hibernate-validator/deployment/src/main/java/io/quarkus/hibernate/validator/deployment/HibernateValidatorProcessor.java index 5e6efce6602f8..d1e8ccb539a36 100644 --- a/extensions/hibernate-validator/deployment/src/main/java/io/quarkus/hibernate/validator/deployment/HibernateValidatorProcessor.java +++ b/extensions/hibernate-validator/deployment/src/main/java/io/quarkus/hibernate/validator/deployment/HibernateValidatorProcessor.java @@ -47,6 +47,7 @@ import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.arc.processor.BeanInfo; import io.quarkus.arc.processor.BuiltinScope; +import io.quarkus.arc.processor.DotNames; import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.Capability; import io.quarkus.deployment.Feature; @@ -307,6 +308,11 @@ private static void contributeBuiltinConstraints(Set builtinConstraints, private static void contributeClass(Set classNamesCollector, IndexView indexView, DotName className) { classNamesCollector.add(className); + + if (DotNames.OBJECT.equals(className)) { + return; + } + for (ClassInfo subclass : indexView.getAllKnownSubclasses(className)) { if (Modifier.isAbstract(subclass.flags())) { // we can avoid adding the abstract classes here: either they are parent classes