You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by jo...@apache.org on 2013/06/13 12:46:55 UTC

git commit: Fixed license header as well as an issue with optional instances.

Updated Branches:
  refs/heads/master b1fe60612 -> c14988763


Fixed license header as well as an issue with optional instances.


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

Branch: refs/heads/master
Commit: c149887635b14021f89ec7e5b91cb72d3384f72e
Parents: b1fe606
Author: John D. Ament <jo...@gmail.com>
Authored: Thu Jun 13 06:45:20 2013 -0400
Committer: John D. Ament <jo...@gmail.com>
Committed: Thu Jun 13 06:46:38 2013 -0400

----------------------------------------------------------------------
 .../impl/CDIAwareConstraintValidatorFactory.java  |  9 ++++++---
 .../impl/src/test/resources/validation.xml        | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/c1498876/deltaspike/modules/beanval/impl/src/main/java/org/apache/deltaspike/beanval/impl/CDIAwareConstraintValidatorFactory.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/beanval/impl/src/main/java/org/apache/deltaspike/beanval/impl/CDIAwareConstraintValidatorFactory.java b/deltaspike/modules/beanval/impl/src/main/java/org/apache/deltaspike/beanval/impl/CDIAwareConstraintValidatorFactory.java
index ca9c12f..223d88c 100644
--- a/deltaspike/modules/beanval/impl/src/main/java/org/apache/deltaspike/beanval/impl/CDIAwareConstraintValidatorFactory.java
+++ b/deltaspike/modules/beanval/impl/src/main/java/org/apache/deltaspike/beanval/impl/CDIAwareConstraintValidatorFactory.java
@@ -27,6 +27,11 @@ import javax.validation.Validation;
 
 import org.apache.deltaspike.core.api.provider.BeanProvider;
 
+/**
+ * A factory for creating CDI Aware/Enabled ConstraintValidators.
+ * 
+ * @author John.D.Ament
+ */
 public class CDIAwareConstraintValidatorFactory implements
         ConstraintValidatorFactory
 {
@@ -50,8 +55,7 @@ public class CDIAwareConstraintValidatorFactory implements
     public <T extends ConstraintValidator<?, ?>> T getInstance(Class<T> validatorClass)
     {
         T resolvedInst = null;
-        resolvedInst = BeanProvider.getContextualReference(validatorClass);
-        
+        resolvedInst = BeanProvider.getContextualReference(validatorClass,true);
         if (resolvedInst == null)
         {
             if (log.isLoggable(Level.CONFIG))
@@ -61,7 +65,6 @@ public class CDIAwareConstraintValidatorFactory implements
             }
             resolvedInst = this.delegate.getInstance(validatorClass);
         }
-        
         return resolvedInst;
     }
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/c1498876/deltaspike/modules/beanval/impl/src/test/resources/validation.xml
----------------------------------------------------------------------
diff --git a/deltaspike/modules/beanval/impl/src/test/resources/validation.xml b/deltaspike/modules/beanval/impl/src/test/resources/validation.xml
index 189e730..bdaa07b 100644
--- a/deltaspike/modules/beanval/impl/src/test/resources/validation.xml
+++ b/deltaspike/modules/beanval/impl/src/test/resources/validation.xml
@@ -1,3 +1,21 @@
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
 <validation-config xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration">