You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/18 03:57:55 UTC

[GitHub] [spark] LuciferYang opened a new pull request #35565: [SPARK-38248][CORE][SQL] Add `@nowarn` to suppress warnings related to `java.io.Serializable` interface

LuciferYang opened a new pull request #35565:
URL: https://github.com/apache/spark/pull/35565


   ### What changes were proposed in this pull request?
   There are 5 api related to `java.io.Serializable` interface:
   
   - private void writeObject(java.io.ObjectOutputStream out) throws IOException
   - private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException;
   - private void readObjectNoData() throws ObjectStreamException;
   - ANY-ACCESS-MODIFIER Object writeReplace() throws ObjectStreamException;
   - ANY-ACCESS-MODIFIER Object readResolve() throws ObjectStreamException;
   
   And the implementations of these methods is mistaken for unused in Spark code, for example Intellij identify them as `Declaration is never used` and in we enabled the compilation options related to `unused`, there will also be relevant compilation warning log.
   
   So this pr add `@nowarn` for this method to suppress related warnings, the added rules are as follows:
   
   - If it has one instance in a file, it uses it without importing (@scala.annotation.nowarn)
   - If it has more than one instances, it imports
   
   
   ### Why are the changes needed?
   Suppress unwanted warnings
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Pass GA


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #35565: [SPARK-38248][CORE][DSTREAM][PYTHON][SQL] Add `@nowarn` to suppress warnings related to `java.io.Serializable` interface

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #35565:
URL: https://github.com/apache/spark/pull/35565#discussion_r809658903



##########
File path: core/src/main/scala/org/apache/spark/Partitioner.scala
##########
@@ -250,6 +251,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
     result
   }
 
+  @nowarn

Review comment:
       Hm, qq: does it suppress all the warnings from this func?




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #35565: [SPARK-38248][CORE][SQL] Add `@nowarn` to suppress warnings related to `java.io.Serializable` interface

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #35565:
URL: https://github.com/apache/spark/pull/35565#issuecomment-1043849495


   cc @HyukjinKwon 


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on a change in pull request #35565: [SPARK-38248][CORE][DSTREAM][PYTHON][SQL] Add `@nowarn` to suppress warnings related to `java.io.Serializable` interface

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on a change in pull request #35565:
URL: https://github.com/apache/spark/pull/35565#discussion_r809677985



##########
File path: core/src/main/scala/org/apache/spark/Partitioner.scala
##########
@@ -250,6 +251,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
     result
   }
 
+  @nowarn

Review comment:
       No, for example, if we declare an unused `val` in the func or the input parameter `out` is not used, the currently configured `@nowarn` will not suppress them.
   
   




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #35565: [SPARK-38248][CORE][DSTREAM][PYTHON][SQL] Add `@nowarn` to suppress warnings related to `java.io.Serializable` interface

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #35565:
URL: https://github.com/apache/spark/pull/35565#issuecomment-1044516228


   > I don't think this is worth annotating, if it's specific to IJ - isn't it smart enough to recognize these as standard serialization methods, like isn't there a setting for it?
   
   Ok, let me find how to setting in IJ
   


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang commented on pull request #35565: [SPARK-38248][CORE][DSTREAM][PYTHON][SQL] Add `@nowarn` to suppress warnings related to `java.io.Serializable` interface

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #35565:
URL: https://github.com/apache/spark/pull/35565#issuecomment-1046043467


   Close this pr first although I haven't found out how to setting in IJ


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] LuciferYang closed pull request #35565: [SPARK-38248][CORE][DSTREAM][PYTHON][SQL] Add `@nowarn` to suppress warnings related to `java.io.Serializable` interface

Posted by GitBox <gi...@apache.org>.
LuciferYang closed pull request #35565:
URL: https://github.com/apache/spark/pull/35565


   


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org