eaolson commented on a change in pull request #4854:
URL: https://github.com/apache/nifi/pull/4854#discussion_r591966827
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/NiFiPropertiesLoader.java
##########
@@ -174,6 +177,18 @@ ProtectedNiFiProperties
readProtectedPropertiesFromDisk(File file) {
rawProperties.load(inStream);
logger.info("Loaded {} properties from {}", rawProperties.size(),
file.getAbsolutePath());
+ // Trim whitespace from each property. If property is multi-line,
remove anything after the first line break.
+ Set<String> keys = rawProperties.stringPropertyNames();
+ Iterator<String> itr = keys.iterator();
+ while(itr.hasNext()){
+ String key = itr.next();
+ String prop = rawProperties.getProperty(key);
+ if(!prop.isEmpty()){
+ prop =
Pattern.compile("\\s+$").matcher(prop).replaceFirst("");
Review comment:
I've moved the pattern compilation out of the loop.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]