Author: rmannibucau
Date: Thu Nov 21 17:52:03 2013
New Revision: 1544265
URL: http://svn.apache.org/r1544265
Log:
accept defaults only when not null
Modified:
bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java
Modified:
bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java
URL:
http://svn.apache.org/viewvc/bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java?rev=1544265&r1=1544264&r2=1544265&view=diff
==============================================================================
---
bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java
(original)
+++
bval/branches/bval-11/bval-jsr/src/main/java/org/apache/bval/jsr/ConfigurationImpl.java
Thu Nov 21 17:52:03 2013
@@ -133,6 +133,9 @@ public class ConfigurationImpl implement
* {@inheritDoc}
*/
public ApacheValidatorConfiguration
traversableResolver(TraversableResolver resolver) {
+ if (resolver == null) {
+ return this;
+ }
traversableResolver = resolver;
this.prepared = false;
return this;
@@ -154,6 +157,9 @@ public class ConfigurationImpl implement
* {@inheritDoc}
*/
public ConfigurationImpl messageInterpolator(MessageInterpolator resolver)
{
+ if (resolver == null) {
+ return this;
+ }
this.messageInterpolator = resolver;
this.prepared = false;
return this;
@@ -164,12 +170,19 @@ public class ConfigurationImpl implement
*/
public ConfigurationImpl constraintValidatorFactory(
ConstraintValidatorFactory constraintFactory) {
+ if (constraintFactory == null) {
+ return this;
+ }
+
this.constraintValidatorFactory = constraintFactory;
this.prepared = false;
return this;
}
public ApacheValidatorConfiguration
parameterNameProvider(ParameterNameProvider parameterNameProvider) {
+ if (parameterNameProvider == null) {
+ return this;
+ }
this.parameterNameProvider = parameterNameProvider;
return this;
}
@@ -182,6 +195,9 @@ public class ConfigurationImpl implement
* @return this
*/
public ApacheValidatorConfiguration addMapping(InputStream stream) {
+ if (stream == null) {
+ return this;
+ }
mappingStreams.add(IOs.convertToMarkableInputStream(stream));
return this;
}