You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2023/01/10 14:55:03 UTC

[GitHub] [hadoop] szilard-nemeth commented on a diff in pull request #4655: YARN-11216. Avoid unnecessary reconstruction of ConfigurationProperties

szilard-nemeth commented on code in PR #4655:
URL: https://github.com/apache/hadoop/pull/4655#discussion_r1065875469


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java:
##########
@@ -871,6 +877,15 @@ public Configuration(Configuration other) {
     setQuietMode(other.getQuietMode());
   }
 
+  protected synchronized void setPropListeners(
+      BiConsumer<String, String> propAddListener,
+      Consumer<String> propRemoveListener
+  ) {
+    this.properties = null;

Review Comment:
   I don't think it's okay to use the assert statement here, see: https://www.baeldung.com/java-avoid-null-check#assertions
   Objects.requireNonNull is fine I think.



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

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org