exceptionfactory commented on code in PR #11953:
URL: https://github.com/apache/nifi/pull/11953#discussion_r4655490602


##########
nifi-extension-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/GetHDFSFileInfo.java:
##########
@@ -846,9 +846,8 @@ public void updateTotals(boolean deepUpdate) {
             }
 
             for (HDFSObjectInfoDetails c : children) {
-                if (c.isSymlink()) {
-                    continue; //do not count symlinks. they either will be 
counted under their actual directories, or won't be count if actual location is 
not under provided root for scan.
-                } else if (c.isDirectory()) {
+                //do not count symlinks. they either will be counted under 
their actual directories, or won't be counted if actual location is not under 
provided root for scan.
+                if (c.isDirectory()) {

Review Comment:
   This actually appears to be a subtle behavior change, I recommend reverting 
it.



##########
nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/scheduling/StandardLifecycleStateManager.java:
##########
@@ -49,8 +47,6 @@ public LifecycleState getOrRegisterLifecycleState(final 
String componentId, fina
                 if (replaced) {
                     lifecycleState = newLifecycleState;
                     break;
-                } else {
-                    continue;

Review Comment:
   This is subtle, apparently consistent, but the nested conditionals or 
complex enough that I recommend reverting this change.



##########
nifi-extension-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-task/src/main/java/org/apache/nifi/reporting/SiteToSiteStatusReportingTask.java:
##########
@@ -455,14 +455,14 @@ private static void addField(final JsonObjectBuilder 
builder, final JsonBuilderF
             final JsonObjectBuilder mapBuilder = factory.createObjectBuilder();
             for (final Map.Entry<String, Long> entry : values.entrySet()) {
 
-                if (entry.getKey() == null) {
-                    continue;
-                } else if (entry.getValue() == null) {
-                    if (allowNullValues) {
-                        mapBuilder.add(entry.getKey(), JsonValue.NULL);
+                if (entry.getKey() != null) {
+                    if (entry.getValue() == null) {
+                        if (allowNullValues) {
+                            mapBuilder.add(entry.getKey(), JsonValue.NULL);
+                        }
+                    } else {
+                        mapBuilder.add(entry.getKey(), entry.getValue());
                     }
-                } else {
-                    mapBuilder.add(entry.getKey(), entry.getValue());

Review Comment:
   This appears to be equivalent, but not necessarily easier to read, I 
recommend reverting it.



-- 
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