Skip to content

Commit

Permalink
Register jakarta.validation.ConstraintViolation unconditionally
Browse files Browse the repository at this point in the history
The class is accessed even when not using hibernate validator.

Relates to #41995
  • Loading branch information
zakkak authored and yrodiere committed Jan 20, 2025
1 parent eeec7ee commit 43677f9
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@ AdditionalIndexedClassesBuildItem addPersistenceUnitAnnotationToIndex() {
@BuildStep
public void enrollBeanValidationTypeSafeActivatorForReflection(Capabilities capabilities,
BuildProducer<ReflectiveClassBuildItem> reflectiveClasses) {
if (capabilities.isPresent(Capability.HIBERNATE_VALIDATOR)) {
reflectiveClasses.produce(ReflectiveClassBuildItem.builder("org.hibernate.boot.beanvalidation.TypeSafeActivator")
.methods().fields().build());
reflectiveClasses.produce(ReflectiveClassBuildItem.builder(BeanValidationIntegrator.JAKARTA_BV_CHECK_CLASS)
.constructors(false).build());
}
// Accessed in org.hibernate.boot.beanvalidation.BeanValidationIntegrator.loadTypeSafeActivatorClass
reflectiveClasses.produce(ReflectiveClassBuildItem.builder("org.hibernate.boot.beanvalidation.TypeSafeActivator")
.methods().fields().build());
// Accessed in org.hibernate.boot.beanvalidation.BeanValidationIntegrator.isBeanValidationApiAvailable
reflectiveClasses.produce(ReflectiveClassBuildItem.builder(BeanValidationIntegrator.JAKARTA_BV_CHECK_CLASS)
.constructors(false).build());
}

@BuildStep
Expand Down

0 comments on commit 43677f9

Please sign in to comment.