Repository: incubator-nifi Updated Branches: refs/heads/NIFI-250 1cee43678 -> 1abee2964
NIFI-250: Fixed bug that caused IllegalArgumentException when loading reporting tasks on NCM if property is not set Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/abd1dc33 Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/abd1dc33 Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/abd1dc33 Branch: refs/heads/NIFI-250 Commit: abd1dc3362ef6297eb3f044aadc58c181114fe06 Parents: 1efa053 Author: Mark Payne <[email protected]> Authored: Tue Mar 31 08:41:45 2015 -0400 Committer: Mark Payne <[email protected]> Committed: Tue Mar 31 08:41:45 2015 -0400 ---------------------------------------------------------------------- .../nifi/cluster/manager/impl/WebClusterManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/abd1dc33/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java ---------------------------------------------------------------------- diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java index 9752ed7..eff523a 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java @@ -983,12 +983,18 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C resolvedProps = new HashMap<>(); for (final Map.Entry<String, String> entry : properties.entrySet()) { final PropertyDescriptor descriptor = reportingTask.getPropertyDescriptor(entry.getKey()); - resolvedProps.put(descriptor, entry.getValue()); + if ( entry.getValue() == null ) { + resolvedProps.put(descriptor, descriptor.getDefaultValue()); + } else { + resolvedProps.put(descriptor, entry.getValue()); + } } } for (final Map.Entry<PropertyDescriptor, String> entry : resolvedProps.entrySet()) { - reportingTaskNode.setProperty(entry.getKey().getName(), entry.getValue()); + if ( entry.getValue() != null ) { + reportingTaskNode.setProperty(entry.getKey().getName(), entry.getValue()); + } } final String comments = DomUtils.getChildText(taskElement, "comment");
