exceptionfactory commented on code in PR #11682:
URL: https://github.com/apache/nifi/pull/11682#discussion_r4029689326
##########
nifi-mock/src/main/java/org/apache/nifi/util/MockProcessSession.java:
##########
@@ -1501,6 +1479,14 @@ boolean isFlowFileKnown(final FlowFile flowFile) {
return curUuid.equals(providedUuid);
}
+ private MockFlowFile getAsMockFlowFile(FlowFile flowFile, String
errMessage) {
Review Comment:
This new method appears unnecessary because `validateState()` already checks
for `null` and also returns `MockFlowFile`.
##########
nifi-framework-bundle/nifi-framework-extensions/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/main/java/org/apache/nifi/provenance/index/lucene/QueryTask.java:
##########
@@ -156,7 +156,7 @@ public void run() {
final Tuple<List<ProvenanceEventRecord>, Long> eventsAndTotalHits
= readDocuments(topDocs, storedFields);
- if (eventsAndTotalHits == null) {
+ if (eventsAndTotalHits.getKey().isEmpty() &&
eventsAndTotalHits.getValue() == 0L) {
Review Comment:
It looks like `readDocuments()` can never return `null`, so this moves in
the right direction, but the code now follows the condition. Instead, I
recommend removing this conditional and the associated following code, so that
the `else` condition is the only path that runs. That aligns the change with
current behavior.
##########
nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/result/writer/Table.java:
##########
@@ -29,7 +29,7 @@ public class Table {
private Table(final Builder builder) {
this.columns = Collections.unmodifiableList(
- builder.columns == null ? Collections.emptyList() : new
ArrayList<>(builder.columns));
+ builder.columns.isEmpty() ? Collections.emptyList() : new
ArrayList<>(builder.columns));
Review Comment:
The conditional can be removed and the `new ArrayList` can be used without
the check
--
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]