]> source.dussan.org Git - poi.git/commitdiff
[github-344] refactor equals method in XSSFHyperlinkRecord
authorPJ Fanning <fanningpj@apache.org>
Fri, 15 Jul 2022 21:20:32 +0000 (21:20 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 15 Jul 2022 21:20:32 +0000 (21:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1902751 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xssf/binary/XSSFHyperlinkRecord.java

index 080048af45a8a31b5f283180230bc653d9938e05..611903ddffb03420a08e2921aa006c60c705c510 100644 (file)
@@ -89,17 +89,16 @@ public class XSSFHyperlinkRecord {
 
         XSSFHyperlinkRecord that = (XSSFHyperlinkRecord) o;
 
-        if (cellRangeAddress != null ? !cellRangeAddress.equals(that.cellRangeAddress) : that.cellRangeAddress != null)
-            return false;
-        if (relId != null ? !relId.equals(that.relId) : that.relId != null) return false;
-        if (location != null ? !location.equals(that.location) : that.location != null) return false;
-        if (toolTip != null ? !toolTip.equals(that.toolTip) : that.toolTip != null) return false;
-        return display != null ? display.equals(that.display) : that.display == null;
+        return Objects.equals(cellRangeAddress, that.cellRangeAddress) &&
+                Objects.equals(relId, that.relId) &&
+                Objects.equals(location, that.location) &&
+                Objects.equals(toolTip, that.toolTip) &&
+                Objects.equals(display, that.display);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(cellRangeAddress,relId,location,toolTip,display);
+        return Objects.hash(cellRangeAddress, relId, location, toolTip, display);
     }
 
     @Override