Add byte[] and ArrayList to more efficient version of deep copy / copy constructor

This commit is contained in:
2023-11-30 20:18:30 -06:00
parent 19d7559dbf
commit c3d35bf110
2 changed files with 29 additions and 1 deletions

View File

@ -158,10 +158,15 @@ public class QRecord implements Serializable
//////////////////////////////////////////////////////////////////////////
// not sure from where/how java.sql.Date objects are getting in here... //
//////////////////////////////////////////////////////////////////////////
if(value == null || value instanceof String || value instanceof Number || value instanceof Boolean || value instanceof Temporal || value instanceof Date)
if(value == null || value instanceof String || value instanceof Number || value instanceof Boolean || value instanceof Temporal || value instanceof Date || value instanceof byte[])
{
clone.put(entry.getKey(), entry.getValue());
}
else if(entry.getValue() instanceof ArrayList<?> arrayList)
{
ArrayList<?> cloneList = new ArrayList<>(arrayList);
clone.put(entry.getKey(), (V) cloneList);
}
else if(entry.getValue() instanceof Serializable serializableValue)
{
LOG.info("Non-primitive serializable value in QRecord - calling SerializationUtils.clone...", logPair("key", entry.getKey()), logPair("type", value.getClass()));