From ef0018cf662de6c1d2272f3d62a4d0bbc53d8bfb Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Tue, 16 Feb 2016 14:34:40 +0100 Subject: [PATCH] NIFI-1282 This closes #228. Fixed error message when attempting to start a disabled port Fixed error message when attempting to start a disabled port Signed-off-by: joewitt --- .../java/org/apache/nifi/controller/AbstractPort.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractPort.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractPort.java index 9f86f08c8b..e2341715e3 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractPort.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractPort.java @@ -539,8 +539,13 @@ public abstract class AbstractPort implements Port { public void verifyCanStart() { readLock.lock(); try { - if (scheduledState.get() != ScheduledState.STOPPED) { - throw new IllegalStateException(this + " is not stopped"); + switch (scheduledState.get()) { + case DISABLED: + throw new IllegalStateException(this + " cannot be started because it is disabled"); + case RUNNING: + throw new IllegalStateException(this + " cannot be started because it is already running"); + case STOPPED: + break; } verifyNoActiveThreads();