Skip to content

Commit 5f1422e

Browse files
committed
correct/consolidate stringutils usage
1 parent b172633 commit 5f1422e

File tree

2 files changed

+11
-18
lines changed

2 files changed

+11
-18
lines changed

nifi/stackable/patches/2.4.0/0005-replace-process-groups-root-with-root-ID.patch

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From cd8d70c7fc112bfe1cd4478bb477b15e70744da1 Mon Sep 17 00:00:00 2001
1+
From ed80d426e85c7b741d865f866092e89b61742c10 Mon Sep 17 00:00:00 2001
22
From: Andrew Kenworthy <andrew.kenworthy@stackable.tech>
33
Date: Fri, 10 Oct 2025 15:28:56 +0200
44
Subject: replace process groups root with root ID
@@ -43,26 +43,18 @@ index 0000000000..3039c97497
4343
+ void onRootGroupLoaded();
4444
+}
4545
diff --git a/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java b/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
46-
index 5363bb5619..db377bb9d3 100644
46+
index 5363bb5619..a03a18d444 100644
4747
--- a/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
4848
+++ b/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
49-
@@ -16,6 +16,7 @@
50-
*/
51-
package org.apache.nifi.authorization;
52-
53-
+import com.google.common.base.Strings;
54-
import org.apache.commons.lang3.StringUtils;
55-
import org.apache.nifi.authorization.annotation.AuthorizerContext;
56-
import org.apache.nifi.authorization.exception.AuthorizationAccessException;
57-
@@ -29,6 +30,7 @@ import org.apache.nifi.authorization.resource.ResourceType;
49+
@@ -29,6 +29,7 @@ import org.apache.nifi.authorization.resource.ResourceType;
5850
import org.apache.nifi.authorization.util.IdentityMapping;
5951
import org.apache.nifi.authorization.util.IdentityMappingUtil;
6052
import org.apache.nifi.components.PropertyValue;
6153
+import org.apache.nifi.controller.StandardFlowService;
6254
import org.apache.nifi.util.FlowInfo;
6355
import org.apache.nifi.util.FlowParser;
6456
import org.apache.nifi.util.NiFiProperties;
65-
@@ -77,6 +79,8 @@ import java.util.concurrent.atomic.AtomicReference;
57+
@@ -77,6 +78,8 @@ import java.util.concurrent.atomic.AtomicReference;
6658
import java.util.regex.Matcher;
6759
import java.util.regex.Pattern;
6860

@@ -71,7 +63,7 @@ index 5363bb5619..db377bb9d3 100644
7163
public class FileAccessPolicyProvider implements ConfigurableAccessPolicyProvider {
7264

7365
private static final Logger logger = LoggerFactory.getLogger(FileAccessPolicyProvider.class);
74-
@@ -133,6 +137,9 @@ public class FileAccessPolicyProvider implements ConfigurableAccessPolicyProvide
66+
@@ -133,6 +136,9 @@ public class FileAccessPolicyProvider implements ConfigurableAccessPolicyProvide
7567
public void initialize(AccessPolicyProviderInitializationContext initializationContext) throws AuthorizerCreationException {
7668
userGroupProviderLookup = initializationContext.getUserGroupProviderLookup();
7769

@@ -81,7 +73,7 @@ index 5363bb5619..db377bb9d3 100644
8173
try {
8274
final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
8375
authorizationsSchema = schemaFactory.newSchema(FileAccessPolicyProvider.class.getResource(AUTHORIZATIONS_XSD));
84-
@@ -744,6 +751,42 @@ public class FileAccessPolicyProvider implements ConfigurableAccessPolicyProvide
76+
@@ -744,6 +750,43 @@ public class FileAccessPolicyProvider implements ConfigurableAccessPolicyProvide
8577
}
8678
}
8779

@@ -92,7 +84,8 @@ index 5363bb5619..db377bb9d3 100644
9284
+ */
9385
+ public void replaceWithRootGroupId() throws JAXBException {
9486
+ String placeholder = this.properties.getProperty(ROOT_PROCESS_GROUP_PLACEHOLDER, "");
95-
+ if (!Strings.isNullOrEmpty(placeholder)) {
87+
+
88+
+ if (StringUtils.isNotBlank(placeholder)) {
9689
+ if (rootGroupId == null) {
9790
+ logger.info("Parsing flow as rootGroupId is not yet defined");
9891
+ parseFlow();

nifi/stackable/patches/2.6.0/0006-replace-process-groups-root-with-root-ID.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 5abbf351e769a64019332335da5f7d12c6c85868 Mon Sep 17 00:00:00 2001
1+
From b9d72e6d64e8d813c846285da127c3fa9114f894 Mon Sep 17 00:00:00 2001
22
From: Andrew Kenworthy <andrew.kenworthy@stackable.tech>
33
Date: Thu, 4 Dec 2025 15:07:07 +0100
44
Subject: replace process groups root with root ID
@@ -43,7 +43,7 @@ index 0000000000..3039c97497
4343
+ void onRootGroupLoaded();
4444
+}
4545
diff --git a/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java b/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
46-
index b4a0be42d3..5100a3ba21 100644
46+
index b4a0be42d3..93d5f73a2c 100644
4747
--- a/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
4848
+++ b/nifi-framework-bundle/nifi-framework/nifi-file-authorizer/src/main/java/org/apache/nifi/authorization/FileAccessPolicyProvider.java
4949
@@ -34,6 +34,7 @@ import org.apache.nifi.authorization.resource.ResourceType;
@@ -85,7 +85,7 @@ index b4a0be42d3..5100a3ba21 100644
8585
+ public void replaceWithRootGroupId() throws JAXBException {
8686
+ String placeholder = this.properties.getProperty(ROOT_PROCESS_GROUP_PLACEHOLDER, "");
8787
+
88-
+ if (!StringUtils.isNotBlank(placeholder)) {
88+
+ if (StringUtils.isNotBlank(placeholder)) {
8989
+ if (rootGroupId == null) {
9090
+ logger.info("Parsing flow as rootGroupId is not yet defined");
9191
+ parseFlow();

0 commit comments

Comments
 (0)