File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
common/unsafe/src/main/java/org/apache/spark/unsafe
core/src/main/scala/org/apache/spark/storage Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,8 @@ public final class Platform {
8888 private static final Method CLEANER_CREATE_METHOD ;
8989 static {
9090 // The implementation of Cleaner changed from JDK 8 to 9
91- int majorVersion = Integer .parseInt (System .getProperty ("java.version" ).split ("\\ ." )[0 ]);
91+ // Split java.version on non-digit chars:
92+ int majorVersion = Integer .parseInt (System .getProperty ("java.version" ).split ("\\ D+" )[0 ]);
9293 String cleanerClassName ;
9394 if (majorVersion < 9 ) {
9495 cleanerClassName = "sun.misc.Cleaner" ;
Original file line number Diff line number Diff line change @@ -201,7 +201,8 @@ private[spark] object StorageUtils extends Logging {
201201 // reflection. However sun.misc.Unsafe added a invokeCleaner() method in JDK 9+ and this is
202202 // still accessible with reflection.
203203 private val bufferCleaner : DirectBuffer => Unit =
204- if (System .getProperty(" java.version" ).split(" \\ ." ).head.toInt < 9 ) {
204+ // Split java.version on non-digit chars:
205+ if (System .getProperty(" java.version" ).split(" \\ D+" ).head.toInt < 9 ) {
205206 // scalastyle:off classforname
206207 val cleanerMethod = Class .forName(" sun.misc.Cleaner" ).getMethod(" clean" )
207208 // scalastyle:on classforname
You can’t perform that action at this time.
0 commit comments