HHH-6408 Be tolerant with empty (ie not null) properties
This commit is contained in:
parent
671a273e75
commit
f0a8fe5643
|
@ -160,7 +160,12 @@ public final class ConfigurationHelper {
|
||||||
return (Integer) value;
|
return (Integer) value;
|
||||||
}
|
}
|
||||||
if ( String.class.isInstance( value ) ) {
|
if ( String.class.isInstance( value ) ) {
|
||||||
return Integer.valueOf( (String) value );
|
//empty values are ignored
|
||||||
|
final String trimmed = value.toString().trim();
|
||||||
|
if ( trimmed.isEmpty() ) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return Integer.valueOf( trimmed );
|
||||||
}
|
}
|
||||||
throw new ConfigurationException(
|
throw new ConfigurationException(
|
||||||
"Could not determine how to handle configuration value [name=" + name +
|
"Could not determine how to handle configuration value [name=" + name +
|
||||||
|
|
Loading…
Reference in New Issue