pvillard31 commented on code in PR #11366:
URL: https://github.com/apache/nifi/pull/11366#discussion_r3465414209


##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitJson.java:
##########
@@ -195,14 +195,12 @@ public void onTrigger(final ProcessContext 
processContext, final ProcessSession
             return;
         }
 
-        if (!(jsonPathResult instanceof List)) {
+        if (!(jsonPathResult instanceof List resultList)) {

Review Comment:
   Since the cast is being removed anyway, should resultList be parameterized 
as List<?> rather than kept as a raw List?



##########
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/MapRecord.java:
##########
@@ -557,16 +557,14 @@ public void regenerateSchema() {
             } else if (fieldValue instanceof final Record childRecord) {
                 childRecord.regenerateSchema();
                 schemaFields.add(new RecordField(schemaField.getFieldName(), 
RecordFieldType.RECORD.getRecordDataType(childRecord.getSchema()), 
schemaField.isNullable()));
-            } else if (schemaField.getDataType().getFieldType() == 
RecordFieldType.ARRAY && fieldValue instanceof Object[]) {
+            } else if (schemaField.getDataType().getFieldType() == 
RecordFieldType.ARRAY && fieldValue instanceof Object[] array) {

Review Comment:
   Should the new pattern variables use final (for example instanceof final 
Record childRecord), to match the code style rule that any variable that can be 
final must be final, and the existing final pattern variable already in this 
file?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to