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 2019/02/22 05:36:21 UTC

[GitHub] srowen commented on a change in pull request #23866: [SPARK-26963][MLLIB] SizeEstimator can't make some JDK fields accessible in Java 9+

srowen commented on a change in pull request #23866: [SPARK-26963][MLLIB] SizeEstimator can't make some JDK fields accessible in Java 9+
URL: https://github.com/apache/spark/pull/23866#discussion_r259217664
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/util/SizeEstimator.scala
 ##########
 @@ -334,9 +334,21 @@ object SizeEstimator extends Logging {
         if (fieldClass.isPrimitive) {
           sizeCount(primitiveSize(fieldClass)) += 1
         } else {
-          field.setAccessible(true) // Enable future get()'s on this field
+          // Note: in Java 9+ this would be better with trySetAccessible and canAccess
+          try {
+            field.setAccessible(true) // Enable future get()'s on this field
+            pointerFields = field :: pointerFields
 
 Review comment:
   No, the point is that we don't want to try to access it below; it's not accessible

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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