I'm working on an Database Synchronization tool and my problem is, when i have a char/varchar column type and it's field is empty on a select statement the method CharacterTypeDescriptor.wrap(X value, WrapperOptions options) throws a StringIndexOutOfBoundsException. By the way, looking at the implementation of method:
"...
if ( String.class.isInstance( value ) ) {
final String str = (String) value;
return Character.valueOf( str.charAt(0) );
..."
I can realize that the problem is on the "str.charAt(0)", my field(s) doesn't have any information, is empty and the system is a legacy system, I cannot modify that information. About the implementation of "wrap" it cannot be done this way:
"...
if ( String.class.isInstance( value ) ) {
final String str = (String) value;
if(str.length() == 0) {
return null
} else {
return Character.valueOf( str.charAt(0) );
}
..."
??
Any solution that I can do?
|