-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix precommit errors #12500
Fix precommit errors #12500
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
|
||
import static org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.rel.rel2sql.SqlImplementor.POS; | ||
|
||
import java.util.Objects; | ||
import java.util.function.IntFunction; | ||
import org.apache.beam.repackaged.core.org.apache.commons.lang3.text.translate.CharSequenceTranslator; | ||
import org.apache.beam.repackaged.core.org.apache.commons.lang3.text.translate.EntityArrays; | ||
|
@@ -110,6 +111,26 @@ private static class SqlDateTimeLiteral extends SqlLiteral { | |
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { | ||
writer.literal("DATETIME '" + timestampString.toString() + "'"); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
if (!super.equals(o)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check is a bit confusing. Why use super's equal to check an object of current class? Something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah so this comes from #12348? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just automatically generated by IntelliJ |
||
return false; | ||
} | ||
SqlDateTimeLiteral that = (SqlDateTimeLiteral) o; | ||
return Objects.equals(timestampString, that.timestampString); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(super.hashCode(), timestampString); | ||
} | ||
} | ||
|
||
private static class SqlByteStringLiteral extends SqlLiteral { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ZijieSong946 This class is a good candidate for AutoValue to eliminate this boilerplate.
(This got missed in #12348 because it was merged without a Jenkins run. cc: @robinyqiu )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, my bad. I only run spotless and checkStyle locally but not spotBugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks for fixing that.