nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi-minifi-cpp] phrocker commented on a change in pull request #623: MINIFICPP-1000 - Add proper logging for configuration loading
Date Thu, 08 Aug 2019 19:34:00 GMT
phrocker commented on a change in pull request #623: MINIFICPP-1000 - Add proper logging for
configuration loading
URL: https://github.com/apache/nifi-minifi-cpp/pull/623#discussion_r312207899
 
 

 ##########
 File path: libminifi/src/Properties.cpp
 ##########
 @@ -122,26 +115,27 @@ bool Properties::parseConfigureFileLine(char *buf, std::string &prop_key,
std::s
 
 // Load Configure File
 void Properties::loadConfigureFile(const char *fileName) {
-  std::string adjustedFilename;
-  if (fileName) {
-    // perform a naive determination if this is a relative path
-    if (fileName[0] != FILE_SEPARATOR_C) {
-      adjustedFilename = adjustedFilename + getHome() + FILE_SEPARATOR_C + fileName;
-    } else {
-      if (adjustedFilename.empty()) {
-        adjustedFilename = getHome();
-      }
-      adjustedFilename += fileName;
-    }
+  if (NULL == fileName) {
+    logger_->log_error("Configuration file path for %s is a nullptr!", getName().c_str());
+    return;
+  }
+
+  std::string adjustedFilename = getHome();
+  // perform a naive determination if this is a relative path
 
 Review comment:
   nice at quick glance this seems to clean up the logic and code. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message