Skip to content
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

[SPARK-45512][CORE][SQL][SS][DSTREAM] Fix compilation warnings related to other-nullary-override #43332

Closed
wants to merge 8 commits into from

Conversation

LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Oct 11, 2023

What changes were proposed in this pull request?

This PR fixes two compilation warnings related to other-nullary-override

[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/CloseableIterator.scala:36:16: method with a single empty parameter list overrides method hasNext in trait Iterator defined without a parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.WrappedCloseableIterator
[error]   override def hasNext(): Boolean = innerIterator.hasNext
[error]                ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/ExecutePlanResponseReattachableIterator.scala:136:16: method without a parameter list overrides method hasNext in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.ExecutePlanResponseReattachableIterator
[error]   override def hasNext: Boolean = synchronized {
[error]                ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcExceptionConverter.scala:73:20: method without a parameter list overrides method hasNext in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.GrpcExceptionConverter.convertIterator
[error]       override def hasNext: Boolean = {
[error]                    ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcRetryHandler.scala:77:18: method without a parameter list overrides method next in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.GrpcRetryHandler.RetryIterator
[error]     override def next: U = {
[error]                  ^
[error] /Users/yangjie01/SourceCode/git/spark-mine-sbt/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/GrpcRetryHandler.scala:81:18: method without a parameter list overrides method hasNext in class WrappedCloseableIterator defined with a single empty parameter list [quickfixable]
[error] Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=other-nullary-override, site=org.apache.spark.sql.connect.client.GrpcRetryHandler.RetryIterator
[error]     override def hasNext: Boolean = {
[error]

and removes the corresponding suppression rules from the compilation options

"-Wconf:cat=other-nullary-override:wv",

On the other hand, the code corresponding to the following three suppression rules no longer exists, so the corresponding suppression rules were also cleaned up in this pr.

"-Wconf:cat=lint-multiarg-infix:wv",
"-Wconf:msg=method with a single empty parameter list overrides method without any parameter list:s",
"-Wconf:msg=method without a parameter list overrides a method with a single empty one:s",

Why are the changes needed?

Code clean up.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass GitHub Actions

Was this patch authored or co-authored using generative AI tooling?

No

@LuciferYang LuciferYang marked this pull request as draft October 11, 2023 15:08
@LuciferYang
Copy link
Contributor Author

Test first

@LuciferYang LuciferYang changed the title Fix compilation warnings related to lint-multiarg-infix/other-nullary-override Fix compilation warnings related to other-nullary-override Oct 12, 2023
@LuciferYang LuciferYang changed the title Fix compilation warnings related to other-nullary-override [SPARK-45512][CORE][SQL][SS][DSTREAM] Fix compilation warnings related to other-nullary-override Oct 12, 2023
@LuciferYang LuciferYang marked this pull request as ready for review October 12, 2023 08:12
Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good pending tests

@LuciferYang
Copy link
Contributor Author

will re-trigger failed task later

@LuciferYang
Copy link
Contributor Author

friendly ping @srowen, All test passed, can we merge this one?

@srowen srowen closed this in 3b46cc8 Oct 17, 2023
@srowen
Copy link
Member

srowen commented Oct 17, 2023

Merged to master

@LuciferYang LuciferYang deleted the other-nullary-override branch October 18, 2023 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants