You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bval.apache.org by mb...@apache.org on 2018/03/27 16:49:04 UTC
[4/5] bval git commit: arrays inherit Object for CV computation
purposes
arrays inherit Object for CV computation purposes
Project: http://git-wip-us.apache.org/repos/asf/bval/repo
Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/237fb504
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/237fb504
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/237fb504
Branch: refs/heads/bv2
Commit: 237fb504c7fb5e7c72ef29d7795bf99c14d878b5
Parents: e135a11
Author: Matt Benson <mb...@apache.org>
Authored: Tue Mar 27 11:47:59 2018 -0500
Committer: Matt Benson <mb...@apache.org>
Committed: Tue Mar 27 11:47:59 2018 -0500
----------------------------------------------------------------------
.../apache/bval/jsr/job/ComputeConstraintValidatorClass.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/bval/blob/237fb504/bval-jsr/src/main/java/org/apache/bval/jsr/job/ComputeConstraintValidatorClass.java
----------------------------------------------------------------------
diff --git a/bval-jsr/src/main/java/org/apache/bval/jsr/job/ComputeConstraintValidatorClass.java b/bval-jsr/src/main/java/org/apache/bval/jsr/job/ComputeConstraintValidatorClass.java
index d9c0b56..123754b 100644
--- a/bval-jsr/src/main/java/org/apache/bval/jsr/job/ComputeConstraintValidatorClass.java
+++ b/bval-jsr/src/main/java/org/apache/bval/jsr/job/ComputeConstraintValidatorClass.java
@@ -201,10 +201,11 @@ class ComputeConstraintValidatorClass<A extends Annotation>
final TypeWrapper w = new TypeWrapper(Reflection.primitiveToWrapper(validatedType));
Stream.Builder<Class<?>> hierarchy = Stream.builder();
Reflection.hierarchy(w.componentType, Interfaces.INCLUDE).forEach(hierarchy);
- if (validatedType.isInterface()) {
- hierarchy.accept(Object.class);
+ final Stream<Class<?>> result = hierarchy.build().map(w::unwrapArrayComponentType);
+ if (validatedType.isInterface() || validatedType.isArray()) {
+ return Stream.concat(result, Stream.of(Object.class));
}
- return hierarchy.build().map(w::unwrapArrayComponentType);
+ return result;
}
private boolean isComposed() {