Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
mrotteveel committed Sep 26, 2023
1 parent d8a9f43 commit c454fa7
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

import static java.util.Collections.*;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
import static org.firebirdsql.jaybird.util.StringUtils.trimToNull;

/**
Expand Down Expand Up @@ -241,12 +240,7 @@ public String toString() {
*/
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ConnectionProperty)) return false;

ConnectionProperty that = (ConnectionProperty) o;

return name.equals(that.name);
return this == o || o instanceof ConnectionProperty that && name.equals(that.name);
}

/**
Expand Down Expand Up @@ -296,8 +290,8 @@ private static List<String> normalizeValues(List<String> values) {
List<String> normalizedValues = values.stream()
.map(StringUtils::trimToNull)
.filter(Objects::nonNull)
.collect(toList());
return normalizedValues.isEmpty() ? emptyList() : unmodifiableList(normalizedValues);
.toList();
return normalizedValues.isEmpty() ? emptyList() : normalizedValues;
}

public static final class Builder {
Expand Down

0 comments on commit c454fa7

Please sign in to comment.