Skip to content

Commit

Permalink
HV-645 Making sure ElementDescriptor#getType() exposes the complete g…
Browse files Browse the repository at this point in the history
…eneric type
  • Loading branch information
gunnarmorling authored and hferentschik committed Jan 10, 2014
1 parent e5e4649 commit b5622a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -16,6 +16,7 @@
*/
package org.hibernate.validator.internal.metadata.aggregated;

import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
Expand All @@ -41,6 +42,7 @@
import org.hibernate.validator.internal.metadata.raw.ExecutableElement;
import org.hibernate.validator.internal.util.CollectionHelper;
import org.hibernate.validator.internal.util.ExecutableHelper;
import org.hibernate.validator.internal.util.ReflectionHelper;
import org.hibernate.validator.internal.util.logging.Log;
import org.hibernate.validator.internal.util.logging.LoggerFactory;

Expand Down Expand Up @@ -83,7 +85,7 @@ public class ExecutableMetaData extends AbstractConstraintMetaData {

private ExecutableMetaData(
String name,
Class<?> returnType,
Type returnType,
Class<?>[] parameterTypes,
ElementKind kind,
Set<MetaConstraint<?>> returnValueConstraints,
Expand Down Expand Up @@ -367,7 +369,7 @@ public ExecutableMetaData build() {

return new ExecutableMetaData(
executable.getSimpleName(),
executable.getReturnType(),
ReflectionHelper.typeOf( executable.getMember() ),
executable.getParameterTypes(),
kind == ConstrainedElement.ConstrainedElementKind.CONSTRUCTOR ? ElementKind.CONSTRUCTOR : ElementKind.METHOD,
adaptOriginsAndImplicitGroups( getConstraints() ),
Expand Down
Expand Up @@ -169,7 +169,7 @@ public Builder(Class<?> beanClass, ConstrainedField constrainedField, Constraint
super( beanClass, constraintHelper );

this.propertyName = ReflectionHelper.getPropertyName( constrainedField.getLocation().getMember() );
this.propertyType = ( (Field) constrainedField.getLocation().getMember() ).getGenericType();
this.propertyType = ReflectionHelper.typeOf( constrainedField.getLocation().getMember() );
add( constrainedField );
}

Expand All @@ -185,7 +185,7 @@ public Builder(Class<?> beanClass, ConstrainedExecutable constrainedMethod, Cons
super( beanClass, constraintHelper );

this.propertyName = ReflectionHelper.getPropertyName( constrainedMethod.getLocation().getMember() );
this.propertyType = constrainedMethod.getLocation().typeOfAnnotatedElement();
this.propertyType = ReflectionHelper.typeOf( constrainedMethod.getLocation().getMember() );
add( constrainedMethod );
}

Expand Down

0 comments on commit b5622a2

Please sign in to comment.