This is an automated email from the ASF dual-hosted git repository.

pvillard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 811c0d09834 NIFI-15679 Add default cases to switches on nifi-api Enums 
(#10978)
811c0d09834 is described below

commit 811c0d0983409186273f84bf1f052385819b901e
Author: Kevin Doran <[email protected]>
AuthorDate: Fri Mar 6 14:22:51 2026 -0500

    NIFI-15679 Add default cases to switches on nifi-api Enums (#10978)
---
 .../nifi/registry/flow/mapping/VersionedComponentStateLookup.java       | 1 +
 .../org/apache/nifi/controller/serialization/AffectedComponentSet.java  | 1 +
 .../apache/nifi/controller/serialization/VersionedDataflowMapper.java   | 1 +
 .../src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java    | 2 ++
 4 files changed, 5 insertions(+)

diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentStateLookup.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentStateLookup.java
index 39d30ad99c1..ec794345229 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentStateLookup.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentStateLookup.java
@@ -99,6 +99,7 @@ public interface VersionedComponentStateLookup {
             return switch (ruleNode.getState()) {
                 case DISABLED -> ScheduledState.DISABLED;
                 case ENABLED -> ScheduledState.ENABLED;
+                default -> throw new IllegalArgumentException("Unexpected 
FlowAnalysisRuleState: " + ruleNode.getState());
             };
         }
 
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/AffectedComponentSet.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/AffectedComponentSet.java
index 3c9eb4e4fe4..14db42393da 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/AffectedComponentSet.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/AffectedComponentSet.java
@@ -516,6 +516,7 @@ public class AffectedComponentSet {
             case OUTPUT_PORT -> flowManager.getOutputPort(identifier);
             case PROCESSOR -> flowManager.getProcessorNode(identifier);
             case REMOTE_INPUT_PORT, REMOTE_OUTPUT_PORT -> 
flowManager.getRootGroup().findRemoteGroupPort(identifier);
+            default -> throw new IllegalArgumentException("Unexpected 
ConnectableComponentType: " + type);
         };
     }
 
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedDataflowMapper.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedDataflowMapper.java
index 7fddd47b935..d55e8d6c620 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedDataflowMapper.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/serialization/VersionedDataflowMapper.java
@@ -194,6 +194,7 @@ public class VersionedDataflowMapper {
                 return switch (ruleNode.getState()) {
                     case DISABLED -> ScheduledState.DISABLED;
                     case ENABLED -> ScheduledState.ENABLED;
+                    default -> throw new IllegalArgumentException("Unexpected 
FlowAnalysisRuleState: " + ruleNode.getState());
                 };
             }
 
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index 78bccb20b03..940310d3e8c 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -4103,6 +4103,7 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
                 case OUTPUT_PORT -> authorizableLookup.getOutputPort(sourceId);
                 case REMOTE_PROCESS_GROUP -> 
authorizableLookup.getRemoteProcessGroup(sourceId);
                 case PROCESS_GROUP -> 
authorizableLookup.getProcessGroup(sourceId).getAuthorizable();
+                default -> throw new IllegalArgumentException("Unexpected 
ComponentType: " + type);
             };
         } catch (final ResourceNotFoundException e) {
             // if the underlying component is gone, disallow
@@ -6454,6 +6455,7 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
                 case AccessPolicy -> 
authorizableLookup.getAccessPolicyById(sourceId);
                 case User, UserGroup -> authorizableLookup.getTenant();
                 case Label -> authorizableLookup.getLabel(sourceId);
+                default -> throw new IllegalArgumentException("Unexpected 
Component: " + type);
             };
         } catch (final ResourceNotFoundException e) {
             // if the underlying component is gone, use the controller to see 
if permissions should be allowed

Reply via email to