Skip to content

Commit 5dc29f0

Browse files
author
Marcelo Vanzin
committed
[SPARK-16385][core] Catch correct exception when calling method via reflection.
Using "Method.invoke" causes an exception to be throw, not an error, so Utils.waitForProcess() was always throwing an exception when run on Java 7.
1 parent 5b7a177 commit 5dc29f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,7 @@ private[spark] object Utils extends Logging {
18131813
.invoke(process, timeoutMs.asInstanceOf[java.lang.Long], TimeUnit.MILLISECONDS)
18141814
.asInstanceOf[Boolean]
18151815
} catch {
1816-
case _: NoSuchMethodError =>
1816+
case _: NoSuchMethodException =>
18171817
// Otherwise implement it manually
18181818
var terminated = false
18191819
val startTime = System.currentTimeMillis

0 commit comments

Comments
 (0)