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/09 01:24:00 UTC

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

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



##########
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:
       Sure. And this is also the style I prefer. I made the `if` clause like this cause I want to have the same style as line 83, 84. Will modify all these 3 lines.




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