Add QRecord as a handled type inside deepCopySimpleMap (e.g., so copy constructor won't need to warn about it and do slow serialization-based cloning).

This commit is contained in:
2024-01-04 18:11:05 -06:00
parent 92b052fe59
commit 93dcee9f61
2 changed files with 22 additions and 12 deletions

View File

@ -151,6 +151,14 @@ class QRecordTest extends BaseTest
QRecord recordWithArrayListValue = new QRecord().withValue("myList", originalArrayList);
QRecord cloneWithArrayListValue = new QRecord(recordWithArrayListValue);
////////////////////////////////////////////
// qrecord as a value inside another (!?) //
////////////////////////////////////////////
QRecord nestedQRecordValue = new QRecord().withValue("myRecord", new QRecord().withValue("A", 1));
QRecord cloneWithNestedQRecord = new QRecord(nestedQRecordValue);
assertEquals(1, ((QRecord) cloneWithNestedQRecord.getValue("myRecord")).getValueInteger("A"));
assertNotSame(cloneWithNestedQRecord.getValue("myRecord"), nestedQRecordValue.getValue("myRecord"));
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// the clone list and original list should be equals (have contents that are equals), but not be the same (reference) //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////