arpadboda commented on a change in pull request #643: MINIFICPP-14: Prune class
names. Add option to config
URL: https://github.com/apache/nifi-minifi-cpp/pull/643#discussion_r322181190
##########
File path: libminifi/src/utils/ClassUtils.cpp
##########
@@ -26,13 +26,19 @@ namespace nifi {
namespace minifi {
namespace utils {
-void ClassUtils::shortenClassName(const std::string &class_name, std::string
&out) {
+bool ClassUtils::shortenClassName(const std::string &class_name, std::string
&out) {
std::string class_delim = "::";
auto class_split = utils::StringUtils::split(class_name, class_delim);
// support . and ::
- if (class_split.size() <= 1 && class_name.find(".") != std::string::npos) {
- class_delim = ".";
- class_split = utils::StringUtils::split(class_name, class_delim);
+ if (class_split.size() <= 1) {
+ if (class_name.find(".") != std::string::npos) {
+ class_delim = ".";
+ class_split = utils::StringUtils::split(class_name, class_delim);
+ } else {
+ // if no update can be performed, return false to let the developer know
+ // this. Out will have no updates
+ return false;
+ }
}
for (auto &elem : class_split) {
if (&elem != &class_split.back() && elem.size() > 1) {
Review comment:
Tricky :)
----------------------------------------------------------------
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]
With regards,
Apache Git Services