You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/06/26 13:11:18 UTC

[GitHub] [nifi-minifi-cpp] hunyadi-dev opened a new pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

hunyadi-dev opened a new pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824


   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
        in the commit message?
   
   - [ ] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
   


----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
hunyadi-dev commented on a change in pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824#discussion_r446839898



##########
File path: libminifi/include/core/state/UpdatePolicy.h
##########
@@ -69,11 +69,9 @@ class UpdatePolicy {
   }
 
  protected:
-  explicit UpdatePolicy(const UpdatePolicy &other)
-      : enable_all_(other.enable_all_), properties_(other.properties_) {
-  }
+  UpdatePolicy(const UpdatePolicy &other) = default;
 
-  explicit UpdatePolicy(const UpdatePolicy &&other)
+  UpdatePolicy(UpdatePolicy &&other)

Review comment:
       Changed the move constructor and the move assignment as well.




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
hunyadi-dev commented on a change in pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824#discussion_r446232265



##########
File path: extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp
##########
@@ -159,8 +159,7 @@ SourceInitiatedSubscriptionListener::Handler::Handler(SourceInitiatedSubscriptio
 
 SourceInitiatedSubscriptionListener::SubscriberData::SubscriberData()
     : bookmark_(nullptr)
-    , subscription_(nullptr) {
-}
+    , subscription_(nullptr) = default;

Review comment:
       Removed.

##########
File path: libminifi/include/core/state/FlowIdentifier.h
##########
@@ -68,12 +68,7 @@ class FlowIdentifier {
     bucket_id_ = other.bucket_id_;
     flow_id_ = other.flow_id_;
   }
-  FlowIdentifier &operator=(const FlowIdentifier &other) {
-    registry_url_ = other.registry_url_;
-    bucket_id_ = other.bucket_id_;
-    flow_id_ = other.flow_id_;
-    return *this;
-  }
+  FlowIdentifier &operator=(const FlowIdentifier &other) = default;

Review comment:
       As requested.

##########
File path: extensions/windows-event-log/wel/WindowsEventLog.h
##########
@@ -63,8 +63,7 @@ typedef std::vector<std::pair<METADATA, std::string>> METADATA_NAMES;
 class WindowsEventLogHandler
 {
 public:
-  WindowsEventLogHandler() : metadata_provider_(nullptr){
-  }
+  WindowsEventLogHandler() : metadata_provider_(nullptr) = default;

Review comment:
       Corrected.

##########
File path: libminifi/include/core/state/UpdatePolicy.h
##########
@@ -122,10 +120,7 @@ class UpdatePolicyBuilder {
 
 
  protected:
-  explicit UpdatePolicyBuilder(const UpdatePolicyBuilder &other)
-      : current_policy_(other.current_policy_) {
-  }
-
+  explicit UpdatePolicyBuilder(const UpdatePolicyBuilder &other) = default;

Review comment:
       Done.

##########
File path: libminifi/include/core/state/UpdatePolicy.h
##########
@@ -69,9 +69,7 @@ class UpdatePolicy {
   }
 
  protected:
-  explicit UpdatePolicy(const UpdatePolicy &other)
-      : enable_all_(other.enable_all_), properties_(other.properties_) {
-  }
+  explicit UpdatePolicy(const UpdatePolicy &other) = default;

Review comment:
       Done.

##########
File path: extensions/opencv/FrameIO.h
##########
@@ -30,7 +30,7 @@ class FrameWriteCallback : public OutputStreamCallback {
     // TODO - Nghia: Check std::move(img_mat).
         : image_mat_(std::move(image_mat)), image_encoding_(image_encoding_) {
     }
-    ~FrameWriteCallback() override = default;
+    ~FrameWriteCallback() = default;

Review comment:
       Restored.




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824#discussion_r446195218



##########
File path: extensions/jni/jvm/JavaClass.h
##########
@@ -46,9 +46,7 @@ class JavaClass {
  public:
 
   JavaClass()
-      : class_ref_(nullptr) {
-
-  }
+      : class_ref_(nullptr) = default;

Review comment:
       This looks incorrect to me.

##########
File path: libminifi/include/core/state/UpdatePolicy.h
##########
@@ -69,9 +69,7 @@ class UpdatePolicy {
   }
 
  protected:
-  explicit UpdatePolicy(const UpdatePolicy &other)
-      : enable_all_(other.enable_all_), properties_(other.properties_) {
-  }
+  explicit UpdatePolicy(const UpdatePolicy &other) = default;

Review comment:
       Would you mind fixing the copy and move ctors by removing the `explicit` specifiers and making the move ctor and assignment operators take mutable rvalue reference? Not strictly related to your changes, but a trivial fix nearby.

##########
File path: extensions/jni/jvm/JniProcessContext.h
##########
@@ -39,8 +39,7 @@ struct JniProcessContext {
       : nifi_processor_(nullptr),
         cslookup_(nullptr),
         processor_(nullptr),
-        context_(nullptr) {
-  }
+        context_(nullptr) = default;

Review comment:
       This is incorrect

##########
File path: extensions/openwsman/processors/SourceInitiatedSubscriptionListener.cpp
##########
@@ -159,8 +159,7 @@ SourceInitiatedSubscriptionListener::Handler::Handler(SourceInitiatedSubscriptio
 
 SourceInitiatedSubscriptionListener::SubscriberData::SubscriberData()
     : bookmark_(nullptr)
-    , subscription_(nullptr) {
-}
+    , subscription_(nullptr) = default;

Review comment:
       This is an error

##########
File path: extensions/windows-event-log/wel/WindowsEventLog.h
##########
@@ -63,8 +63,7 @@ typedef std::vector<std::pair<METADATA, std::string>> METADATA_NAMES;
 class WindowsEventLogHandler
 {
 public:
-  WindowsEventLogHandler() : metadata_provider_(nullptr){
-  }
+  WindowsEventLogHandler() : metadata_provider_(nullptr) = default;

Review comment:
       This is an error

##########
File path: libminifi/include/core/state/UpdatePolicy.h
##########
@@ -122,10 +120,7 @@ class UpdatePolicyBuilder {
 
 
  protected:
-  explicit UpdatePolicyBuilder(const UpdatePolicyBuilder &other)
-      : current_policy_(other.current_policy_) {
-  }
-
+  explicit UpdatePolicyBuilder(const UpdatePolicyBuilder &other) = default;

Review comment:
       Would you mind fixing this copy ctor by removing the `explicit` specifier?

##########
File path: extensions/opencv/FrameIO.h
##########
@@ -30,7 +30,7 @@ class FrameWriteCallback : public OutputStreamCallback {
     // TODO - Nghia: Check std::move(img_mat).
         : image_mat_(std::move(image_mat)), image_encoding_(image_encoding_) {
     }
-    ~FrameWriteCallback() override = default;
+    ~FrameWriteCallback() = default;

Review comment:
       Please restore the `override` specifier

##########
File path: libminifi/include/core/Relationship.h
##########
@@ -78,11 +74,7 @@ class Relationship {
     return name_ < right.name_;
   }
 
-  Relationship &operator=(const Relationship &other) {
-    name_ = other.name_;
-    description_ = other.description_;
-    return *this;
-  }
+  Relationship &operator=(const Relationship &other) = default;

Review comment:
       :+1:
   
   Not only did you simplify the code, but you also handled self-assignment of many classes, including this one. Thanks.

##########
File path: libminifi/include/core/state/FlowIdentifier.h
##########
@@ -68,12 +68,7 @@ class FlowIdentifier {
     bucket_id_ = other.bucket_id_;
     flow_id_ = other.flow_id_;
   }
-  FlowIdentifier &operator=(const FlowIdentifier &other) {
-    registry_url_ = other.registry_url_;
-    bucket_id_ = other.bucket_id_;
-    flow_id_ = other.flow_id_;
-    return *this;
-  }
+  FlowIdentifier &operator=(const FlowIdentifier &other) = default;

Review comment:
       Please `=default` the "copy ctor" above as well and remove its `explicit` specifier.




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] szaszm commented on a change in pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824#discussion_r446311283



##########
File path: libminifi/include/core/state/UpdatePolicy.h
##########
@@ -69,11 +69,9 @@ class UpdatePolicy {
   }
 
  protected:
-  explicit UpdatePolicy(const UpdatePolicy &other)
-      : enable_all_(other.enable_all_), properties_(other.properties_) {
-  }
+  UpdatePolicy(const UpdatePolicy &other) = default;
 
-  explicit UpdatePolicy(const UpdatePolicy &&other)
+  UpdatePolicy(UpdatePolicy &&other)

Review comment:
       The move ctor could be defaulted, too.




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
hunyadi-dev commented on a change in pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824#discussion_r446232077



##########
File path: extensions/jni/jvm/JniProcessContext.h
##########
@@ -39,8 +39,7 @@ struct JniProcessContext {
       : nifi_processor_(nullptr),
         cslookup_(nullptr),
         processor_(nullptr),
-        context_(nullptr) {
-  }
+        context_(nullptr) = default;

Review comment:
       Corrected.




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] arpadboda closed pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
arpadboda closed pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824


   


----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
hunyadi-dev commented on a change in pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824#discussion_r446232208



##########
File path: extensions/jni/jvm/JavaClass.h
##########
@@ -46,9 +46,7 @@ class JavaClass {
  public:
 
   JavaClass()
-      : class_ref_(nullptr) {
-
-  }
+      : class_ref_(nullptr) = default;

Review comment:
       Corrected.




----------------------------------------------------------------
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



[GitHub] [nifi-minifi-cpp] arpadboda commented on pull request #824: MINIFICPP-1256 - Apply fixes recommended by modernize-equals-default clang tidy check

Posted by GitBox <gi...@apache.org>.
arpadboda commented on pull request #824:
URL: https://github.com/apache/nifi-minifi-cpp/pull/824#issuecomment-650651948


   LGTM, happy to merge after the remaining comments of @szaszm are addressed.


----------------------------------------------------------------
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