Repository: bval
Updated Branches:
  refs/heads/bv2 861d64d4f -> 330afb5b6


don't composite single delegate


Project: http://git-wip-us.apache.org/repos/asf/bval/repo
Commit: http://git-wip-us.apache.org/repos/asf/bval/commit/e33bd2ab
Tree: http://git-wip-us.apache.org/repos/asf/bval/tree/e33bd2ab
Diff: http://git-wip-us.apache.org/repos/asf/bval/diff/e33bd2ab

Branch: refs/heads/bv2
Commit: e33bd2aba7b9407466ca2dfcc587057898aff3dd
Parents: 861d64d
Author: Matt Benson <mben...@apache.org>
Authored: Thu Feb 22 15:24:28 2018 -0600
Committer: Matt Benson <mben...@apache.org>
Committed: Thu Feb 22 15:24:28 2018 -0600

----------------------------------------------------------------------
 .../org/apache/bval/jsr/descriptor/DescriptorManager.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bval/blob/e33bd2ab/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/DescriptorManager.java
----------------------------------------------------------------------
diff --git 
a/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/DescriptorManager.java 
b/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/DescriptorManager.java
index 21816d7..96a0017 100644
--- 
a/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/DescriptorManager.java
+++ 
b/bval-jsr/src/main/java/org/apache/bval/jsr/descriptor/DescriptorManager.java
@@ -68,7 +68,13 @@ public class DescriptorManager {
         final List<MetadataBuilder.ForBean> customBuilders =
             
validatorFactory.getMetadataBuilders().getCustomBuilders(beanClass);
 
-        return customBuilders.isEmpty() ? null : customBuilders.stream()
+        if (customBuilders.isEmpty()) {
+            return null;
+        }
+        if (customBuilders.size() == 1) {
+            return customBuilders.get(0);
+        }
+        return customBuilders.stream()
             
.collect(CompositeBuilder.with(AnnotationBehaviorMergeStrategy.consensus()).compose());
     }
 }

Reply via email to