3838import org .hibernate .validator .internal .engine .groups .Sequence ;
3939import org .hibernate .validator .internal .engine .groups .ValidationOrder ;
4040import org .hibernate .validator .internal .engine .groups .ValidationOrderGenerator ;
41+ import org .hibernate .validator .internal .engine .path .ModifiablePath ;
4142import org .hibernate .validator .internal .engine .path .NodeImpl ;
42- import org .hibernate .validator .internal .engine .path .PathImpl ;
4343import org .hibernate .validator .internal .engine .resolver .TraversableResolvers ;
4444import org .hibernate .validator .internal .engine .validationcontext .BaseBeanValidationContext ;
4545import org .hibernate .validator .internal .engine .validationcontext .ExecutableValidationContext ;
@@ -164,7 +164,7 @@ public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... grou
164164 validatorScopedContext .getParameterNameProvider (),
165165 object ,
166166 validationContext .getRootBeanMetaData (),
167- PathImpl .createRootPath ()
167+ ModifiablePath .createRootPath ()
168168 );
169169
170170 return validateInContext ( validationContext , valueContext , validationOrder );
@@ -184,7 +184,7 @@ public final <T> Set<ConstraintViolation<T>> validateProperty(T object, String p
184184 return Collections .emptySet ();
185185 }
186186
187- PathImpl propertyPath = PathImpl .createPathFromString ( propertyName );
187+ ModifiablePath propertyPath = ModifiablePath .createPathFromString ( propertyName );
188188 BaseBeanValidationContext <T > validationContext = getValidationContextBuilder ().forValidateProperty ( rootBeanClass , rootBeanMetaData , object ,
189189 propertyPath );
190190
@@ -211,7 +211,7 @@ public final <T> Set<ConstraintViolation<T>> validateValue(Class<T> beanType, St
211211 return Collections .emptySet ();
212212 }
213213
214- PathImpl propertyPath = PathImpl .createPathFromString ( propertyName );
214+ ModifiablePath propertyPath = ModifiablePath .createPathFromString ( propertyName );
215215 BaseBeanValidationContext <T > validationContext = getValidationContextBuilder ().forValidateValue ( beanType , rootBeanMetaData , propertyPath );
216216
217217 ValidationOrder validationOrder = determineGroupValidationOrder ( groups );
@@ -813,7 +813,7 @@ private BeanValueContext<?, Object> buildNewLocalExecutionContext(ValueContext<?
813813 return newValueContext ;
814814 }
815815
816- private <T > Set <ConstraintViolation <T >> validateValueInContext (BaseBeanValidationContext <T > validationContext , Object value , PathImpl propertyPath ,
816+ private <T > Set <ConstraintViolation <T >> validateValueInContext (BaseBeanValidationContext <T > validationContext , Object value , ModifiablePath propertyPath ,
817817 ValidationOrder validationOrder ) {
818818 BeanValueContext <?, Object > valueContext = getValueContextForValueValidation ( validationContext .getRootBeanClass (), propertyPath );
819819 valueContext .setCurrentValidatedValue ( value );
@@ -902,7 +902,7 @@ private <T> void validateParametersInContext(ExecutableValidationContext<T> vali
902902 validatorScopedContext .getParameterNameProvider (),
903903 parameterValues ,
904904 executableMetaData .getValidatableParametersMetaData (),
905- PathImpl .createPathForExecutable ( executableMetaData )
905+ ModifiablePath .createPathForExecutable ( executableMetaData )
906906 );
907907
908908 groupIterator = validationOrder .getGroupIterator ();
@@ -1035,7 +1035,7 @@ private <T> ValueContext<T, Object> getExecutableValueContext(T object, Executab
10351035 validatorScopedContext .getParameterNameProvider (),
10361036 object ,
10371037 validatable ,
1038- PathImpl .createPathForExecutable ( executableMetaData )
1038+ ModifiablePath .createPathForExecutable ( executableMetaData )
10391039 );
10401040
10411041 valueContext .setCurrentGroup ( group );
@@ -1078,7 +1078,7 @@ private <V, T> void validateReturnValueInContext(ExecutableValidationContext<T>
10781078 validatorScopedContext .getParameterNameProvider (),
10791079 value ,
10801080 executableMetaData .getReturnValueMetaData (),
1081- PathImpl .createPathForExecutable ( executableMetaData )
1081+ ModifiablePath .createPathForExecutable ( executableMetaData )
10821082 );
10831083
10841084 groupIterator = validationOrder .getGroupIterator ();
@@ -1184,7 +1184,7 @@ private <T> void validateReturnValueForSingleGroup(BaseBeanValidationContext<T>
11841184 * @return Returns an instance of {@code ValueContext} which describes the local validation context associated to
11851185 * the given property path.
11861186 */
1187- private <V > BeanValueContext <?, V > getValueContextForPropertyValidation (BaseBeanValidationContext <?> validationContext , PathImpl propertyPath ) {
1187+ private <V > BeanValueContext <?, V > getValueContextForPropertyValidation (BaseBeanValidationContext <?> validationContext , ModifiablePath propertyPath ) {
11881188 Class <?> clazz = validationContext .getRootBeanClass ();
11891189 BeanMetaData <?> beanMetaData = validationContext .getRootBeanMetaData ();
11901190 Object value = validationContext .getRootBean ();
@@ -1262,7 +1262,7 @@ else if ( propertyPathNode.getKey() != null ) {
12621262 * the given property path.
12631263 */
12641264 private <V > BeanValueContext <?, V > getValueContextForValueValidation (Class <?> rootBeanClass ,
1265- PathImpl propertyPath ) {
1265+ ModifiablePath propertyPath ) {
12661266 Class <?> clazz = rootBeanClass ;
12671267 BeanMetaData <?> beanMetaData = null ;
12681268 PropertyMetaData propertyMetaData = null ;
@@ -1330,13 +1330,13 @@ private boolean isValidationRequired(BaseBeanValidationContext<?> validationCont
13301330 );
13311331 }
13321332
1333- private boolean isReachable (BaseBeanValidationContext <?> validationContext , Object traversableObject , PathImpl path ,
1333+ private boolean isReachable (BaseBeanValidationContext <?> validationContext , Object traversableObject , ModifiablePath path ,
13341334 ConstraintLocationKind constraintLocationKind ) {
13351335 if ( needToCallTraversableResolver ( path , constraintLocationKind ) ) {
13361336 return true ;
13371337 }
13381338
1339- Path pathToObject = PathImpl .createCopyWithoutLeafNode ( path );
1339+ Path pathToObject = ModifiablePath .createCopyWithoutLeafNode ( path );
13401340 try {
13411341 return validationContext .getTraversableResolver ().isReachable (
13421342 traversableObject ,
@@ -1351,7 +1351,7 @@ private boolean isReachable(BaseBeanValidationContext<?> validationContext, Obje
13511351 }
13521352 }
13531353
1354- private boolean needToCallTraversableResolver (PathImpl path , ConstraintLocationKind constraintLocationKind ) {
1354+ private boolean needToCallTraversableResolver (ModifiablePath path , ConstraintLocationKind constraintLocationKind ) {
13551355 // as the TraversableResolver interface is designed right now it does not make sense to call it when
13561356 // there is no traversable object hosting the property to be accessed. For this reason we don't call the resolver
13571357 // for class level constraints (ElementType.TYPE) or top level method parameters or return values.
@@ -1362,7 +1362,7 @@ private boolean needToCallTraversableResolver(PathImpl path, ConstraintLocationK
13621362 || isReturnValueValidation ( path );
13631363 }
13641364
1365- private boolean isCascadeRequired (BaseBeanValidationContext <?> validationContext , Object traversableObject , PathImpl path ,
1365+ private boolean isCascadeRequired (BaseBeanValidationContext <?> validationContext , Object traversableObject , ModifiablePath path ,
13661366 ConstraintLocationKind constraintLocationKind ) {
13671367 if ( needToCallTraversableResolver ( path , constraintLocationKind ) ) {
13681368 return true ;
@@ -1373,7 +1373,7 @@ private boolean isCascadeRequired(BaseBeanValidationContext<?> validationContext
13731373 return false ;
13741374 }
13751375
1376- Path pathToObject = PathImpl .createCopyWithoutLeafNode ( path );
1376+ Path pathToObject = ModifiablePath .createCopyWithoutLeafNode ( path );
13771377 try {
13781378 return validationContext .getTraversableResolver ().isCascadable (
13791379 traversableObject ,
@@ -1392,15 +1392,15 @@ private boolean isClassLevelConstraint(ConstraintLocationKind constraintLocation
13921392 return ConstraintLocationKind .TYPE .equals ( constraintLocationKind );
13931393 }
13941394
1395- private boolean isCrossParameterValidation (PathImpl path ) {
1395+ private boolean isCrossParameterValidation (ModifiablePath path ) {
13961396 return path .getLeafNode ().getKind () == ElementKind .CROSS_PARAMETER ;
13971397 }
13981398
1399- private boolean isParameterValidation (PathImpl path ) {
1399+ private boolean isParameterValidation (ModifiablePath path ) {
14001400 return path .getLeafNode ().getKind () == ElementKind .PARAMETER ;
14011401 }
14021402
1403- private boolean isReturnValueValidation (PathImpl path ) {
1403+ private boolean isReturnValueValidation (ModifiablePath path ) {
14041404 return path .getLeafNode ().getKind () == ElementKind .RETURN_VALUE ;
14051405 }
14061406
0 commit comments