File tree Expand file tree Collapse file tree
core/src/test/scala/org/apache/spark/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -784,8 +784,10 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging {
784784 signal(pid, " SIGKILL" )
785785 }
786786
787- val v : String = System .getProperty(" java.version" )
788- if (v >= " 1.8.0" ) {
787+ val versionParts = System .getProperty(" java.version" ).split(" [+.\\ -]+" , 3 )
788+ var majorVersion = versionParts(0 ).toInt
789+ if (majorVersion == 1 ) majorVersion = versionParts(1 ).toInt
790+ if (majorVersion >= 8 ) {
789791 // Java8 added a way to forcibly terminate a process. We'll make sure that works by
790792 // creating a very misbehaving process. It ignores SIGTERM and has been SIGSTOPed. On
791793 // older versions of java, this will *not* terminate.
Original file line number Diff line number Diff line change @@ -167,8 +167,10 @@ object SparkBuild extends PomBuild {
167167 publishLocalBoth <<= Seq (publishLocal in MavenCompile , publishLocal).dependOn,
168168
169169 javacOptions in (Compile , doc) ++= {
170- val version = System .getProperty(" java.version" )
171- if (version >= " 1.8.0" ) Seq (" -Xdoclint:all" , " -Xdoclint:-missing" ) else Seq .empty
170+ val versionParts = System .getProperty(" java.version" ).split(" [+.\\ -]+" , 3 )
171+ var major = versionParts(0 ).toInt
172+ if (major == 1 ) major = versionParts(1 ).toInt
173+ if (major >= 8 ) Seq (" -Xdoclint:all" , " -Xdoclint:-missing" ) else Seq .empty
172174 },
173175
174176 javacJVMVersion := " 1.7" ,
You can’t perform that action at this time.
0 commit comments