paul-rogers commented on a change in pull request #1955: DRILL-7491: Incorrect
count() returned for complex types in parquet
URL: https://github.com/apache/drill/pull/1955#discussion_r366677192
##########
File path:
logical/src/main/java/org/apache/drill/common/expression/SchemaPath.java
##########
@@ -334,36 +335,13 @@ public int hashCode() {
@Override
public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (!(obj instanceof SchemaPath)) {
- return false;
- }
-
- SchemaPath other = (SchemaPath) obj;
- if (rootSegment == null) {
- return (other.rootSegment == null);
- }
- return rootSegment.equals(other.rootSegment);
+ return this == obj || obj instanceof SchemaPath
+ && Objects.equals(rootSegment, ((SchemaPath) obj).rootSegment);
}
public boolean contains(Object obj) {
Review comment:
`contains()` is not a Java-defined method. Must the signature be `Object`?
Or, can it be `SchemaPath` since that is the only kind of thing a `SchemaPath`
could ever contain? Would save some casting.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services