kaijchen commented on code in PR #38:
URL: https://github.com/apache/incubator-uniffle/pull/38#discussion_r916691332


##########
common/src/main/java/org/apache/uniffle/common/config/RssConf.java:
##########
@@ -532,9 +532,9 @@ public String getValue(ConfigOption<?> configOption) {
   // 
--------------------------------------------------------------------------------------------
 
   @Override
-  public RssConf clone() {
-    RssConf config = new RssConf();
-    config.addAll(this);
+  public RssConf clone() throws CloneNotSupportedException {
+    RssConf config = (RssConf) super.clone();

Review Comment:
   
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#cn-clone-method-does-not-call-super-clone-cn-idiom-no-super-call
   
   > This non-final class defines a clone() method that does not call 
super.clone(). If this class ("A") is extended by a subclass ("B"), and the 
subclass B calls super.clone(), then it is likely that B's clone() method will 
return an object of type A, which violates the standard contract for clone().
   >
   > If all clone() methods call super.clone(), then they are guaranteed to use 
Object.clone(), which always returns an object of the correct type.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to