AIOOBE from validate(Object) method
HV-1737
Entity proxy "children" can not be validated even with TraversableResolver
HV-1735
Avoid creating a full ValidatorFactory to bootstrap the CDI extension
HV-1679
Check why we try to create metadata for Object[] in case of parameter validation and for <return type> in case of return value validation
HV-1678
Not compatible with google's error-prone
HV-1664
Transient MissingResourceException when using annotation processor
HV-1655
validator.validateValue not working for wrapped values
HV-1654
Constrainable#getDeclaringClass() somehow breaks the new reflection abstraction
HV-1632
Explore removing the Executable from JavaBeanExecutable
HV-1621
Explore resolving the parameter names early
HV-1620
GroupSequenceProvider#getValidationGroups() is called 2 times per validation
HV-1618
Provide a way to skip cascading validation (depending on the cascading or the cascaded object)
HV-1613
Use index based validation based on implementation (instead of return value)
HV-1602
Log a warning when @Valid is defined both globally and on a type parameter of a container
HV-1591
Improve TypeHelper#extract(Validated|Constraint)Type() and ValueExtractor Descriptor#getContainerType() logic
HV-1590
Consider to create a new Constraint for @Age
HV-1552
Improve the PathImpl/NodeImpl memory allocation and hashCode computation
HV-1544
Group inheritance acts like Group sequence with @ConvertGroup
HV-1540
Support declaring TYPE_USE constraints in the class declaration
HV-1517
Provide HTTP API for validating properties and accessing constraint metadata
HV-1500
Work with WildFly Swarm team to create a fraction for BV 2.0 / HV 6.0
HV-1468
Explore message interpolator receiving multiple locales
HV-1436
Explore a value extractor for streams
HV-1432
Reenable array support for container elements
HV-1428
Allow to configure validated groups for method validation
HV-1421
Type parameter annotation not found for an inner class
HV-1398
Annotation marked with TYPE_USE and used on a parameter is permitted by JDT but ignored when executed
HV-1397
Keep property node when using constraint validator context API on property constraint
HV-1374
Align TestNG version with the one used by the TCK
HV-1361
Propose to add @ConstraintGroup for explicit groups
HV-1355
Add section on OSGi to chapter 10 in the docs ("Integrating with other frameworks")
HV-1353
Prefer getter-based metadata if in conflict
HV-1338
Follow-up to-dos around value extractor implementation
HV-1334
Add an option to validate class-level constraints only if all property constraints are valid
HV-1328
Move JavaDoc stylesheet.css to separate repo and fetch it from there
HV-1271
Improve JavaDoc rendered by Java 9
HV-1268
ORM - Take into account the addition of NoProviderFoundException in TypeSafeActivator
HV-1267
Explore getDefaultValueExtractors() in HibernateValidatorConfiguration
HV-1263
Use a proper LRU cache in ConstraintValidatorManager
HV-1241
Explore usage of method handles instead of core reflection in ReflectionHelper#getValue()
HV-1226
Experiment with extractors for Ceylon collections
HV-1197
Follow-up to-dos around Lambda based API for constraint definition
HV-1142
Replace TypeHelper by ClassMate usage
HV-1139
Parameter validation works randomly on Weblogic EJB
HV-1028
NoClassDefFoundError: javax.persistence.Persistence (OSGi JPA2)
HV-1027
Provide mechanism for copying constraints from one model to another
HV-1008
Support other object models than JavaBeans (JSON, Maps)
HV-1000
CDI integration causing per-module validation config to be per-application config
HV-987
Allow the configuration of a ResourceBundleLocator via a provider specific property
HV-958
Explore lambdas for the programmatic mapping API
HV-947
issue 1 of 81

AIOOBE from validate(Object) method

Description

I have a simple enum looks like this.

1 2 3 4 5 6 7 public enum Some { // hidden @NotEmpty public final Set<@NotBlank String> profiles; }

And I tested with Hibernate-Validator.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 private static Configuration messageInterpolator(final Configuration configuration) { try { final Class<?> c = Class.forName( "org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator"); configuration.messageInterpolator((MessageInterpolator) c.getConstructor().newInstance()); } catch (final ReflectiveOperationException roe) { roe.printStackTrace(); } return configuration; } private static final ValidatorFactory VALIDATION_FACTORY = messageInterpolator(Validation.byDefaultProvide r().configure()).buildValidatorFactory(); @Test public void assertAllValuesValid() { final Validator validator = VALIDATION_FACTORY.getValidator(); for (final Some value : Some.values()) { assertTrue(validator.validate(value).isEmpty()); } }

And I got this.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 14:36:01.153 [main] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.1.0.Alpha6 14:36:01.158 [main] DEBUG org.hibernate.validator.internal.engine.resolver.TraversableResolvers - Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable. 14:36:01.167 [main] DEBUG org.hibernate.validator.internal.engine.AbstractConfigurationImpl - Setting custom MessageInterpolator of type org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator 14:36:01.170 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - Trying to load META-INF/validation.xml for XML based Validator configuration. 14:36:01.171 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via TCCL 14:36:01.172 [main] DEBUG org.hibernate.validator.internal.xml.config.ResourceLoaderHelper - Trying to load META-INF/validation.xml via Hibernate Validator's class loader 14:36:01.172 [main] DEBUG org.hibernate.validator.internal.xml.config.ValidationXmlParser - No META-INF/validation.xml found. Using annotation based configuration only. 14:36:01.295 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000252: Using org.hibernate.validator.internal.engine.DefaultPropertyNodeNameProvider as property node name provider. 14:36:01.300 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.messageinterpolation.ParameterMessageInterpolator as ValidatorFactory-scoped message interpolator. 14:36:01.300 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.resolver.TraverseAllTraversableResolver as ValidatorFactory-scoped traversable resolver. 14:36:01.300 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.util.ExecutableParameterNameProvider as ValidatorFactory-scoped parameter name provider. 14:36:01.300 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.DefaultClockProvider as ValidatorFactory-scoped clock provider. 14:36:01.300 [main] DEBUG org.hibernate.validator.internal.engine.ValidatorFactoryConfigurationHelper - HV000234: Using org.hibernate.validator.internal.engine.scripting.DefaultScriptEvaluatorFactory as ValidatorFactory-scoped script evaluator factory. java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 at org.hibernate.validator.internal.properties.javabean.JavaBeanExecutable.getParameters(JavaBeanExecutable.java:213) at org.hibernate.validator.internal.properties.javabean.JavaBeanExecutable.<init>(JavaBeanExecutable.java:45) at org.hibernate.validator.internal.properties.javabean.JavaBeanConstructor.<init>(JavaBeanConstructor.java:20) at org.hibernate.validator.internal.properties.javabean.JavaBeanHelper.executable(JavaBeanHelper.java:113) at org.hibernate.validator.internal.properties.javabean.JavaBeanHelper.executable(JavaBeanHelper.java:108) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.findExecutableMetaData(AnnotationMetaDataProvider.java:307) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getMetaData(AnnotationMetaDataProvider.java:292) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getConstructorMetaData(AnnotationMetaDataProvider.java:273) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.retrieveBeanConfiguration(AnnotationMetaDataProvider.java:131) at org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider.getBeanConfiguration(AnnotationMetaDataProvider.java:120) at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.getBeanConfigurationForHierarchy(BeanMetaDataManagerImpl.java:224) at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.createBeanMetaData(BeanMetaDataManagerImpl.java:191) at org.hibernate.validator.internal.metadata.BeanMetaDataManagerImpl.getBeanMetaData(BeanMetaDataManagerImpl.java:156) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:156)

6.0.17.Final seems to be free from this problem.

Environment

java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

Status

Assignee

Unassigned

Reporter

Jin Kwon

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Affects versions

6.1.0.Alpha6

Priority

Major
Configure