Program: 166928
Project: 166928
Buggy source:
@Override public Object convertArray(PropertyType propertyType,java.sql.Array array) throws SQLException {
switch (propertyType) {
case BOOLEAN_ARRAY:
    return array.getArray();
case boolean_ARRAY:
  return SqlgUtil.convertObjectArrayToBooleanPrimitiveArray((Object[])array.getArray());
case SHORT_ARRAY:
return SqlgUtil.convertObjectOfIntegersArrayToShortArray((Object[])array.getArray());
case short_ARRAY:
return SqlgUtil.convertObjectOfIntegersArrayToShortPrimitiveArray((Object[])array.getArray());
case INTEGER_ARRAY:
return array.getArray();
case int_ARRAY:
return SqlgUtil.convertObjectOfIntegersArrayToIntegerPrimitiveArray((Object[])array.getArray());
case LONG_ARRAY:
return array.getArray();
case long_ARRAY:
return SqlgUtil.convertObjectOfLongsArrayToLongPrimitiveArray((Object[])array.getArray());
case DOUBLE_ARRAY:
return array.getArray();
case double_ARRAY:
return SqlgUtil.convertObjectOfDoublesArrayToDoublePrimitiveArray((Object[])array.getArray());
case FLOAT_ARRAY:
return array.getArray();
case float_ARRAY:
return SqlgUtil.convertObjectOfFloatsArrayToFloatPrimitiveArray((Object[])array.getArray());
case STRING_ARRAY:
return array.getArray();
case LOCALDATETIME_ARRAY:
Timestamp[] timestamps=(Timestamp[])array.getArray();
return SqlgUtil.copyToLocalDateTime(timestamps,new LocalDateTime[timestamps.length]);
case LOCALDATE_ARRAY:
Date[] dates=(Date[])array.getArray();
return SqlgUtil.copyToLocalDate(dates,new LocalDate[dates.length]);
case LOCALTIME_ARRAY:
Time[] times=(Time[])array.getArray();
return SqlgUtil.copyToLocalTime(times,new LocalTime[times.length]);
case JSON_ARRAY:
String arrayAsString=array.toString();
arrayAsString=arrayAsString.substring(1);
arrayAsString=arrayAsString.substring(0,arrayAsString.length() - 1);
arrayAsString=StringEscapeUtils.unescapeJava(arrayAsString);
arrayAsString=arrayAsString.substring(1);
arrayAsString=arrayAsString.substring(0,arrayAsString.length() - 1);
String[] jsons=arrayAsString.split("String_Node_Str");
JsonNode[] jsonNodes=new JsonNode[jsons.length];
ObjectMapper objectMapper=new ObjectMapper();
int count=0;
for (String json : jsons) {
try {
JsonNode jsonNode=objectMapper.readTree(json);
jsonNodes[count++]=jsonNode;
}
 catch (IOException e) {
throw new RuntimeException(e);
}
}
return jsonNodes;
default :
throw new IllegalStateException("String_Node_Str" + propertyType.name());
}
}

Fixed version (ground truth):
@Override public Object convertArray(PropertyType propertyType,java.sql.Array array) throws SQLException {
switch (propertyType) {
case BOOLEAN_ARRAY:
    return array.getArray();
case boolean_ARRAY:
  return SqlgUtil.convertObjectArrayToBooleanPrimitiveArray((Object[])array.getArray());
case SHORT_ARRAY:
return SqlgUtil.convertObjectOfIntegersArrayToShortArray((Object[])array.getArray());
case short_ARRAY:
return SqlgUtil.convertObjectOfIntegersArrayToShortPrimitiveArray((Object[])array.getArray());
case INTEGER_ARRAY:
return array.getArray();
case int_ARRAY:
return SqlgUtil.convertObjectOfIntegersArrayToIntegerPrimitiveArray((Object[])array.getArray());
case LONG_ARRAY:
return array.getArray();
case long_ARRAY:
return SqlgUtil.convertObjectOfLongsArrayToLongPrimitiveArray((Object[])array.getArray());
case DOUBLE_ARRAY:
return array.getArray();
case double_ARRAY:
return SqlgUtil.convertObjectOfDoublesArrayToDoublePrimitiveArray((Object[])array.getArray());
case FLOAT_ARRAY:
return array.getArray();
case float_ARRAY:
return SqlgUtil.convertObjectOfFloatsArrayToFloatPrimitiveArray((Object[])array.getArray());
case STRING_ARRAY:
return array.getArray();
case LOCALDATETIME_ARRAY:
Timestamp[] timestamps=(Timestamp[])array.getArray();
return SqlgUtil.copyToLocalDateTime(timestamps,new LocalDateTime[timestamps.length]);
case LOCALDATE_ARRAY:
Date[] dates=(Date[])array.getArray();
return SqlgUtil.copyToLocalDate(dates,new LocalDate[dates.length]);
case LOCALTIME_ARRAY:
Time[] times=(Time[])array.getArray();
LocalTime[] lts=SqlgUtil.copyToLocalTime(times,new LocalTime[times.length]);
for (int a=0; a < times.length; a++) {
lts[a]=shiftDST(lts[a]).toLocalTime();
}
return lts;
case JSON_ARRAY:
String arrayAsString=array.toString();
arrayAsString=arrayAsString.substring(1);
arrayAsString=arrayAsString.substring(0,arrayAsString.length() - 1);
arrayAsString=StringEscapeUtils.unescapeJava(arrayAsString);
arrayAsString=arrayAsString.substring(1);
arrayAsString=arrayAsString.substring(0,arrayAsString.length() - 1);
String[] jsons=arrayAsString.split("String_Node_Str");
JsonNode[] jsonNodes=new JsonNode[jsons.length];
ObjectMapper objectMapper=new ObjectMapper();
int count=0;
for (String json : jsons) {
try {
JsonNode jsonNode=objectMapper.readTree(json);
jsonNodes[count++]=jsonNode;
}
 catch (IOException e) {
throw new RuntimeException(e);
}
}
return jsonNodes;
default :
throw new IllegalStateException("String_Node_Str" + propertyType.name());
}
}