You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by GitBox <gi...@apache.org> on 2020/11/07 15:06:46 UTC

[GitHub] [tika] kkrugler commented on a change in pull request #377: Simplify some equals statement by use Objects.equals

kkrugler commented on a change in pull request #377:
URL: https://github.com/apache/tika/pull/377#discussion_r519186443



##########
File path: tika-eval/src/main/java/org/apache/tika/eval/EvalFilePaths.java
##########
@@ -81,9 +82,8 @@ public boolean equals(Object o) {
 
         if (sourceFileLength != that.sourceFileLength) return false;
         if (extractFileLength != that.extractFileLength) return false;
-        if (relativeSourceFilePath != null ? !relativeSourceFilePath.equals(that.relativeSourceFilePath) : that.relativeSourceFilePath != null)
-            return false;
-        return extractFile != null ? extractFile.equals(that.extractFile) : that.extractFile == null;
+        if (!Objects.equals(relativeSourceFilePath, that.relativeSourceFilePath)) return false;

Review comment:
       In general I think Tika uses a "always braces" style, so this would be better as:
   
   ```java
   if (!blah) {
       return false;
   } else {
       return Objects.equals(blah);
   }
   ```




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