1
0

unit test and improve PostgresArray

This commit is contained in:
Michael Hoennig
2024-01-04 12:38:40 +01:00
parent f8de575b77
commit ea130581a3
2 changed files with 92 additions and 1 deletions

View File

@ -42,7 +42,10 @@ public class PostgresArray {
tokenizer.remove("\"", "\"");
final T[] array = newGenericArray(elementClass, tokenizer.getSize()); // Create a new array of the specified type and length
for ( int n = 0; n < tokenizer.getSize(); ++n ) {
array[n] = itemParser.apply(tokenizer.getToken(n).trim().replace("\\\"", "\""));
final String token = tokenizer.getToken(n);
if ( !"NULL".equals(token) ) {
array[n] = itemParser.apply(token.trim().replace("\\\"", "\""));
}
}
return array;
}