@@ -145,8 +145,8 @@ void visit() {
145
145
rowStruct .emptyDocument = new Document ();
146
146
147
147
final DiRowStructVisitor visitor = new DiRowStructVisitor ();
148
- final Record record = visitor .get (rowStruct , factory );
149
- final Schema schema = record .getSchema ();
148
+ final Record convertedRecord = visitor .get (rowStruct , factory );
149
+ final Schema schema = convertedRecord .getSchema ();
150
150
// should have 3 excluded fields
151
151
assertEquals (58 , schema .getEntries ().size ());
152
152
@@ -198,66 +198,66 @@ void visit() {
198
198
assertEquals ("yyyy-MM-dd" , schema .getEntry ("dynStringDate" ).getProp (PATTERN ));
199
199
assertEquals (StudioTypes .DOCUMENT , schema .getEntry ("dynDocument" ).getProp (STUDIO_TYPE ));
200
200
// asserts Record
201
- assertEquals (":testing:" , record .getString ("id" ));
202
- assertEquals (NAME , record .getString ("name" ));
203
- assertEquals (SHORT , record .getInt ("shortP" ));
204
- assertEquals (SHORT , record .getInt ("shortC" ));
205
- assertEquals (INT , record .getInt ("intP" ));
206
- assertEquals (INT , record .getInt ("intC" ));
207
- assertEquals (LONG , record .getLong ("longP" ));
208
- assertEquals (LONG , record .getLong ("longC" ));
209
- assertEquals (FLOAT , record .getFloat ("floatP" ));
210
- assertEquals (FLOAT , record .getFloat ("floatC" ));
211
- assertEquals (DOUBLE , record .getDouble ("doubleP" ));
212
- assertEquals (DOUBLE , record .getDouble ("doubleC" ));
213
- assertEquals (DATE .toInstant (), record .getDateTime ("date0" ).toInstant ());
214
- assertNull (record .getDateTime ("date1" ));
215
- assertEquals (ZONED_DATE_TIME , record .getDateTime ("date2" ));
216
- assertEquals (1946 , record .getDateTime ("date2" ).getYear ());
217
- assertEquals (INSTANT , record .getInstant ("date4" ));
218
- assertEquals (BIGDEC .doubleValue (), new BigDecimal (record .getString ("bigDecimal0" )).doubleValue ());
219
- assertEquals (BIGDEC .toString (), record .getString ("bigDecimal0" ));
220
- assertFalse (record .getBoolean ("bool0" ));
221
- assertTrue (record .getBoolean ("bool1" ));
222
- assertArrayEquals (BYTES0 , record .getBytes ("bytes0" ));
223
- assertArrayEquals (BYTES0 , record .getBytes ("dynBytes" ));
224
- assertArrayEquals (BYTES0 , record .getBytes ("dynBytesArray" ));
225
- assertArrayEquals (BYTES0 , record .getBytes ("dynBytesBuffer" ));
226
- assertArrayEquals (String .valueOf (BYTES0 ).getBytes (), record .getBytes ("dynBytesWString" ));
227
- assertEquals (BIGDEC .toString (), record .getString ("dynBigDecimal" ));
228
- assertEquals (BIGDEC , new BigDecimal (record .getString ("dynBigDecimal" )));
229
- assertEquals (DOCUMENT .toString (), record .getString ("dynDocument" ));
230
- assertEquals (rowStruct .object0 , record .get (Object .class , "object0" ));
231
- assertTrue (record .getBoolean ("hAshcOdEdIrtY" ));
232
- assertEquals (NAME , record .getString ("h" ));
201
+ assertEquals (":testing:" , convertedRecord .getString ("id" ));
202
+ assertEquals (NAME , convertedRecord .getString ("name" ));
203
+ assertEquals (SHORT , convertedRecord .getInt ("shortP" ));
204
+ assertEquals (SHORT , convertedRecord .getInt ("shortC" ));
205
+ assertEquals (INT , convertedRecord .getInt ("intP" ));
206
+ assertEquals (INT , convertedRecord .getInt ("intC" ));
207
+ assertEquals (LONG , convertedRecord .getLong ("longP" ));
208
+ assertEquals (LONG , convertedRecord .getLong ("longC" ));
209
+ assertEquals (FLOAT , convertedRecord .getFloat ("floatP" ));
210
+ assertEquals (FLOAT , convertedRecord .getFloat ("floatC" ));
211
+ assertEquals (DOUBLE , convertedRecord .getDouble ("doubleP" ));
212
+ assertEquals (DOUBLE , convertedRecord .getDouble ("doubleC" ));
213
+ assertEquals (DATE .toInstant (), convertedRecord .getDateTime ("date0" ).toInstant ());
214
+ assertNull (convertedRecord .getDateTime ("date1" ));
215
+ assertEquals (ZONED_DATE_TIME , convertedRecord .getDateTime ("date2" ));
216
+ assertEquals (1946 , convertedRecord .getDateTime ("date2" ).getYear ());
217
+ assertEquals (INSTANT , convertedRecord .getInstant ("date4" ));
218
+ assertEquals (BIGDEC .doubleValue (), new BigDecimal (convertedRecord .getString ("bigDecimal0" )).doubleValue ());
219
+ assertEquals (BIGDEC .toString (), convertedRecord .getString ("bigDecimal0" ));
220
+ assertFalse (convertedRecord .getBoolean ("bool0" ));
221
+ assertTrue (convertedRecord .getBoolean ("bool1" ));
222
+ assertArrayEquals (BYTES0 , convertedRecord .getBytes ("bytes0" ));
223
+ assertArrayEquals (BYTES0 , convertedRecord .getBytes ("dynBytes" ));
224
+ assertArrayEquals (BYTES0 , convertedRecord .getBytes ("dynBytesArray" ));
225
+ assertArrayEquals (BYTES0 , convertedRecord .getBytes ("dynBytesBuffer" ));
226
+ assertArrayEquals (String .valueOf (BYTES0 ).getBytes (), convertedRecord .getBytes ("dynBytesWString" ));
227
+ assertEquals (BIGDEC .toString (), convertedRecord .getString ("dynBigDecimal" ));
228
+ assertEquals (BIGDEC , new BigDecimal (convertedRecord .getString ("dynBigDecimal" )));
229
+ assertEquals (DOCUMENT .toString (), convertedRecord .getString ("dynDocument" ));
230
+ assertEquals (rowStruct .object0 , convertedRecord .get (Object .class , "object0" ));
231
+ assertTrue (convertedRecord .getBoolean ("hAshcOdEdIrtY" ));
232
+ assertEquals (NAME , convertedRecord .getString ("h" ));
233
233
assertEquals (StudioTypes .CHARACTER , schema .getEntry ("char0" ).getProp (STUDIO_TYPE ));
234
- assertEquals (String .valueOf (Character .MAX_VALUE ), record .getString ("char0" ));
235
- assertEquals (dynObject , record .get (Object .class , "dynObject" ));
236
- assertEquals (STRINGS , record .getArray (String .class , "STRINGS" ));
237
- assertEquals (LONGS , record .getArray (Long .class , "LONGS" ));
238
- assertEquals (FLOATS , record .getArray (Float .class , "FLOATS" ));
239
- assertEquals (DOUBLES , record .getArray (Double .class , "DOUBLES" ));
240
- assertEquals (BOOLEANS , record .getArray (Boolean .class , "BOOLEANS" ));
241
- assertEquals (BYTES , record .getArray (byte [].class , "BYTES" ));
242
- assertEquals (DATES , record .getArray (ZonedDateTime .class , "DATES" ));
243
- assertEquals (RECORDS , record .getArray (Record .class , "RECORDS" ));
244
- record .getArray (Record .class , "RECORDS" ).forEach (r -> {
234
+ assertEquals (String .valueOf (Character .MAX_VALUE ), convertedRecord .getString ("char0" ));
235
+ assertEquals (dynObject , convertedRecord .get (Object .class , "dynObject" ));
236
+ assertEquals (STRINGS , convertedRecord .getArray (String .class , "STRINGS" ));
237
+ assertEquals (LONGS , convertedRecord .getArray (Long .class , "LONGS" ));
238
+ assertEquals (FLOATS , convertedRecord .getArray (Float .class , "FLOATS" ));
239
+ assertEquals (DOUBLES , convertedRecord .getArray (Double .class , "DOUBLES" ));
240
+ assertEquals (BOOLEANS , convertedRecord .getArray (Boolean .class , "BOOLEANS" ));
241
+ assertEquals (BYTES , convertedRecord .getArray (byte [].class , "BYTES" ));
242
+ assertEquals (DATES , convertedRecord .getArray (ZonedDateTime .class , "DATES" ));
243
+ assertEquals (RECORDS , convertedRecord .getArray (Record .class , "RECORDS" ));
244
+ convertedRecord .getArray (Record .class , "RECORDS" ).forEach (r -> {
245
245
assertEquals (1 , r .getInt ("ntgr" ));
246
246
assertEquals ("one" , r .getString ("str" ));
247
247
});
248
- assertEquals (BIG_DECIMALS , record .getArray (BigDecimal .class , "BIG_DECIMALS" ));
248
+ assertEquals (BIG_DECIMALS , convertedRecord .getArray (BigDecimal .class , "BIG_DECIMALS" ));
249
249
assertEquals (3 ,
250
250
schema .getEntries ()
251
251
.stream ()
252
252
.filter (entry -> entry .getName ().matches ("hAshcOdEdIrtY|h|id" ))
253
253
.count ());
254
254
// check list combinations
255
- assertEquals (INTEGERS , record .getArray (Integer .class , "array0" ));
256
- assertEquals (LIST_INTEGERS , record .getArray (List .class , "array1" ));
257
- assertEquals (LIST_HETEROGENEOUS_INTEGER , record .getArray (List .class , "array2" ));
258
- assertEquals (LIST_HETEROGENEOUS_LIST , record .getArray (List .class , "array3" ));
259
- assertEquals (LIST_INTEGERS_EMPTY , record .getArray (List .class , "array4" ));
260
- assertEquals (LIST_3_DEEP , record .getArray (List .class , "array5" ));
255
+ assertEquals (INTEGERS , convertedRecord .getArray (Integer .class , "array0" ));
256
+ assertEquals (LIST_INTEGERS , convertedRecord .getArray (List .class , "array1" ));
257
+ assertEquals (LIST_HETEROGENEOUS_INTEGER , convertedRecord .getArray (List .class , "array2" ));
258
+ assertEquals (LIST_HETEROGENEOUS_LIST , convertedRecord .getArray (List .class , "array3" ));
259
+ assertEquals (LIST_INTEGERS_EMPTY , convertedRecord .getArray (List .class , "array4" ));
260
+ assertEquals (LIST_3_DEEP , convertedRecord .getArray (List .class , "array5" ));
261
261
// check their schemas
262
262
assertSchemaArray0 (schema );
263
263
assertSchemaArray1 (schema );
@@ -273,9 +273,9 @@ void visit() {
273
273
.stream ()
274
274
.filter (entry -> entry .getName ().matches ("hashCodeDirty|loopKey|lookKey" ))
275
275
.count ());
276
- assertThrows (NullPointerException .class , () -> record .getBoolean ("hashCodeDirty" ));
277
- assertNull (record .getString ("loopKey" ));
278
- assertNull (record .getString ("lookKey" ));
276
+ assertThrows (NullPointerException .class , () -> convertedRecord .getBoolean ("hashCodeDirty" ));
277
+ assertNull (convertedRecord .getString ("loopKey" ));
278
+ assertNull (convertedRecord .getString ("lookKey" ));
279
279
}
280
280
281
281
private static void assertSchemaArray0 (final Schema schema ) {
@@ -431,11 +431,11 @@ public void readData(final ObjectInputStream objectInputStream) {
431
431
createMetadata (rowStruct .dynamic , name3 , StudioTypes .LIST , STRINGS , null , true , originalName3 );
432
432
433
433
final DiRowStructVisitor visitor = new DiRowStructVisitor ();
434
- final Record record = visitor .get (rowStruct , factory );
434
+ final Record convertedRecord = visitor .get (rowStruct , factory );
435
435
436
436
// validation
437
437
// schema
438
- final Schema schema = record .getSchema ();
438
+ final Schema schema = convertedRecord .getSchema ();
439
439
assertEquals (3 , schema .getEntries ().size ());
440
440
{
441
441
final Entry testedEntry = schema .getEntry (name1 );
@@ -472,9 +472,9 @@ public void readData(final ObjectInputStream objectInputStream) {
472
472
}
473
473
474
474
// value
475
- assertEquals (STRINGS , record .getArray (String .class , name1 ));
476
- assertEquals (STRINGS , record .getArray (String .class , name2 ));
477
- assertEquals (STRINGS , record .getArray (String .class , name3 ));
475
+ assertEquals (STRINGS , convertedRecord .getArray (String .class , name1 ));
476
+ assertEquals (STRINGS , convertedRecord .getArray (String .class , name2 ));
477
+ assertEquals (STRINGS , convertedRecord .getArray (String .class , name3 ));
478
478
}
479
479
480
480
@ Test
@@ -515,11 +515,11 @@ public void readData(final ObjectInputStream objectInputStream) {
515
515
rowStruct .dynamic .metadatas .get (1 ).setPrecision (7 );
516
516
517
517
final DiRowStructVisitor visitor = new DiRowStructVisitor ();
518
- final Record record = visitor .get (rowStruct , factory );
518
+ final Record convertedRecord = visitor .get (rowStruct , factory );
519
519
520
520
// validation
521
521
// schema
522
- final Schema schema = record .getSchema ();
522
+ final Schema schema = convertedRecord .getSchema ();
523
523
assertEquals (2 , schema .getEntries ().size ());
524
524
{
525
525
final Entry testedEntry = schema .getEntry (name1 );
@@ -545,8 +545,8 @@ public void readData(final ObjectInputStream objectInputStream) {
545
545
}
546
546
547
547
// value
548
- assertEquals (BigDecimal .valueOf (42L ), record .getDecimal (name1 ));
549
- assertEquals (BigDecimal .valueOf (42L ), record .getDecimal (name2 ));
548
+ assertEquals (BigDecimal .valueOf (42L ), convertedRecord .getDecimal (name1 ));
549
+ assertEquals (BigDecimal .valueOf (42L ), convertedRecord .getDecimal (name2 ));
550
550
}
551
551
552
552
@ Test
@@ -577,11 +577,11 @@ public void readData(final ObjectInputStream objectInputStream) {
577
577
createMetadata (rowStruct .dynamic , name2 , StudioTypes .BIGDECIMAL , BigDecimal .valueOf (42L ));
578
578
579
579
final DiRowStructVisitor visitor = new DiRowStructVisitor ();
580
- final Record record = visitor .get (rowStruct , factory );
580
+ final Record convertedRecord = visitor .get (rowStruct , factory );
581
581
582
582
// validation
583
583
// schema
584
- final Schema schema = record .getSchema ();
584
+ final Schema schema = convertedRecord .getSchema ();
585
585
assertEquals (2 , schema .getEntries ().size ());
586
586
{
587
587
final Entry testedEntry = schema .getEntry (name1 );
@@ -607,8 +607,8 @@ public void readData(final ObjectInputStream objectInputStream) {
607
607
}
608
608
609
609
// value
610
- assertTrue (record .getOptionalDecimal (name1 ).isEmpty ());
611
- assertEquals (BigDecimal .valueOf (42L ), record .getDecimal (name2 ));
610
+ assertTrue (convertedRecord .getOptionalDecimal (name1 ).isEmpty ());
611
+ assertEquals (BigDecimal .valueOf (42L ), convertedRecord .getDecimal (name2 ));
612
612
}
613
613
614
614
@ Test
@@ -640,9 +640,9 @@ public void readData(final ObjectInputStream objectInputStream) {
640
640
rowStruct .array1 = LIST_INTEGERS ;
641
641
642
642
final DiRowStructVisitor visitor = new DiRowStructVisitor ();
643
- final Record record = visitor .get (rowStruct , factory );
643
+ final Record convertedRecord = visitor .get (rowStruct , factory );
644
644
645
- final Schema schema = record .getSchema ();
645
+ final Schema schema = convertedRecord .getSchema ();
646
646
assertEquals (2 , schema .getEntries ().size ());
647
647
648
648
// schema metadata
@@ -666,8 +666,8 @@ public void readData(final ObjectInputStream objectInputStream) {
666
666
667
667
// asserts Record
668
668
// check list combinations
669
- assertEquals (INTEGERS , record .getArray (Integer .class , "array0" ));
670
- assertEquals (LIST_INTEGERS , record .getArray (List .class , "array1" ));
669
+ assertEquals (INTEGERS , convertedRecord .getArray (Integer .class , "array0" ));
670
+ assertEquals (LIST_INTEGERS , convertedRecord .getArray (List .class , "array1" ));
671
671
672
672
// check their schemas
673
673
assertSchemaArray0 (schema );
@@ -684,17 +684,17 @@ public static class Rcd {
684
684
@ Data
685
685
public static class RowStructEmptyNull implements routines .system .IPersistableRow {
686
686
687
- public Integer meta_id ;
687
+ public Integer meta_id ; //NOSONAR
688
688
689
- public String FirstName ;
689
+ public String FirstName ; //NOSONAR
690
690
691
691
public String lastName ;
692
692
693
- public String City ;
693
+ public String City ; //NOSONAR
694
694
695
695
public String i ;
696
696
697
- public String A ;
697
+ public String A ; //NOSONAR
698
698
699
699
@ Override
700
700
public void writeData (final ObjectOutputStream objectOutputStream ) {
0 commit comments