From c85ea20679c7f51c6f999cf2df5a43ae3795bd3b Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 9 Oct 2020 12:33:39 +0200 Subject: [PATCH] Don't consider the hierarchy of Object when marked with @Valid Fixes #12443 --- .../validator/deployment/HibernateValidatorProcessor.java | 6 ++++++ 1 file changed, 6 insertions(+) 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