Use Objects.equals().

This commit is contained in:
Gary Gregory 2020-11-20 16:21:30 -05:00
parent 979134603b
commit 810e2eac40
1 changed files with 6 additions and 25 deletions

View File

@ -45,6 +45,7 @@ import java.sql.ResultSetMetaData;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Objects;
import java.util.Set; import java.util.Set;
/** /**
@ -830,32 +831,16 @@ public final class CSVFormat implements Serializable {
if (quoteMode != other.quoteMode) { if (quoteMode != other.quoteMode) {
return false; return false;
} }
if (quoteCharacter == null) { if (!Objects.equals(quoteCharacter, other.quoteCharacter)) {
if (other.quoteCharacter != null) {
return false;
}
} else if (!quoteCharacter.equals(other.quoteCharacter)) {
return false; return false;
} }
if (commentMarker == null) { if (!Objects.equals(commentMarker, other.commentMarker)) {
if (other.commentMarker != null) {
return false;
}
} else if (!commentMarker.equals(other.commentMarker)) {
return false; return false;
} }
if (escapeCharacter == null) { if (!Objects.equals(escapeCharacter, other.escapeCharacter)) {
if (other.escapeCharacter != null) {
return false;
}
} else if (!escapeCharacter.equals(other.escapeCharacter)) {
return false; return false;
} }
if (nullString == null) { if (!Objects.equals(nullString, other.nullString)) {
if (other.nullString != null) {
return false;
}
} else if (!nullString.equals(other.nullString)) {
return false; return false;
} }
if (!Arrays.equals(header, other.header)) { if (!Arrays.equals(header, other.header)) {
@ -870,11 +855,7 @@ public final class CSVFormat implements Serializable {
if (skipHeaderRecord != other.skipHeaderRecord) { if (skipHeaderRecord != other.skipHeaderRecord) {
return false; return false;
} }
if (recordSeparator == null) { if (!Objects.equals(recordSeparator, other.recordSeparator)) {
if (other.recordSeparator != null) {
return false;
}
} else if (!recordSeparator.equals(other.recordSeparator)) {
return false; return false;
} }
if (!Arrays.equals(headerComments, other.headerComments)) { if (!Arrays.equals(headerComments, other.headerComments)) {