Repository: nifi Updated Branches: refs/heads/master cae5b109c -> ef0018cf6
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 <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/ef0018cf Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/ef0018cf Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/ef0018cf Branch: refs/heads/master Commit: ef0018cf662de6c1d2272f3d62a4d0bbc53d8bfb Parents: cae5b10 Author: Pierre Villard <[email protected]> Authored: Tue Feb 16 14:34:40 2016 +0100 Committer: joewitt <[email protected]> Committed: Tue Feb 16 09:38:56 2016 -0500 ---------------------------------------------------------------------- .../main/java/org/apache/nifi/controller/AbstractPort.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/ef0018cf/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractPort.java ---------------------------------------------------------------------- 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 9f86f08..e234171 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();
