From 600a47be166e942b64bcc7c624af5db7b5c17cc2 Mon Sep 17 00:00:00 2001 From: Matt Gilman Date: Mon, 2 Feb 2015 13:40:07 -0500 Subject: [PATCH] NIFI-295: - Considering the default value when a property is unset. --- .../nifi/web/controller/ControllerFacade.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java index b2a1ae4103..b009581079 100644 --- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java +++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java @@ -1190,17 +1190,24 @@ public class ControllerFacade implements ControllerServiceProvider { for (final Map.Entry entry : procNode.getProperties().entrySet()) { final PropertyDescriptor descriptor = entry.getKey(); - addIfAppropriate(searchStr, descriptor.getName(), "Property", matches); - addIfAppropriate(searchStr, descriptor.getDescription(), "Property", matches); + addIfAppropriate(searchStr, descriptor.getName(), "Property name", matches); + addIfAppropriate(searchStr, descriptor.getDescription(), "Property description", matches); // never include sensitive properties values in search results if (descriptor.isSensitive()) { continue; } - final String value = entry.getValue(); + String value = entry.getValue(); + + // if unset consider default value + if (value == null) { + value = descriptor.getDefaultValue(); + } + + // evaluate if the value matches the search criteria if (StringUtils.containsIgnoreCase(value, searchStr)) { - matches.add("Property: " + descriptor.getName() + " - " + value); + matches.add("Property value: " + descriptor.getName() + " - " + value); } }