Simplify .equals code
Opened this issue · 0 comments
thewheat commented
Current code utilises the following format to check for object equality in .equals
methods e.g.
if (website != null ? !website.equals(company.website) : company.website != null) return false;
This is hard to read and could be simplified
Possible solution:
if (!Objects.equals(website, company.website)) return false;
- https://docs.oracle.com/javase/7/docs/api/java/util/Objects.html#equals(java.lang.Object,%20java.lang.Object)
- Requires Java 7
- Java 6 looks to stop receiving updates at the end of this year https://en.wikipedia.org/wiki/Java_version_history
Raised in https://github.com/intercom/intercom-java/pull/183/files#r206175113
Till need to discuss the possibility of adding and enforcing Java 7 minimum version if we were to implement this