arina-ielchiieva commented on a change in pull request #1988: DRILL-7590: 
Refactor plugin registry
URL: https://github.com/apache/drill/pull/1988#discussion_r383986262
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/dfs/FileSystemConfig.java
 ##########
 @@ -72,65 +76,70 @@ public String getConnection() {
     return formats;
   }
 
+  @Override
+  public String getValue(String key) {
+    return config == null ? null : config.get(key);
+  }
+
   @Override
   public int hashCode() {
-    final int prime = 31;
-    int result = 1;
-    result = prime * result + ((config == null) ? 0 : config.hashCode());
-    result = prime * result + ((connection == null) ? 0 : 
connection.hashCode());
-    result = prime * result + ((formats == null) ? 0 : formats.hashCode());
-    result = prime * result + ((workspaces == null) ? 0 : 
workspaces.hashCode());
-    return result;
+    return Objects.hash(connection, config, formats, workspaces);
   }
 
   @Override
   public boolean equals(Object obj) {
     if (this == obj) {
       return true;
     }
-    if (obj == null) {
-      return false;
-    }
-    if (getClass() != obj.getClass()) {
+    if (obj == null || getClass() != obj.getClass()) {
       return false;
     }
     FileSystemConfig other = (FileSystemConfig) obj;
-    if (connection == null) {
-      if (other.connection != null) {
-        return false;
-      }
-    } else if (!connection.equals(other.connection)) {
-      return false;
-    }
-    if (formats == null) {
-      if (other.formats != null) {
-        return false;
-      }
-    } else if (!formats.equals(other.formats)) {
-      return false;
-    }
-    if (workspaces == null) {
-      if (other.workspaces != null) {
-        return false;
-      }
-    } else if (!workspaces.equals(other.workspaces)) {
-      return false;
-    }
-    if (config == null) {
-      if (other.config != null) {
-        return false;
-      }
-    } else if (!config.equals(other.config)) {
-      return false;
-    }
-    return true;
+    return Objects.equals(connection, other.connection) &&
+           Objects.equals(config, other.config) &&
+           Objects.equals(formats, other.formats) &&
+           Objects.equals(workspaces, other.workspaces);
   }
 
   @Override
-  public String getValue(String key) {
-    if (config != null) {
-      return config.get(key);
+  public String toString() {
+    return new PlanStringBuilder(this)
+        .field("connection=", connection)
 
 Review comment:
   Why we need `=` for `connection` but for other fields we don't?

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

Reply via email to