mirror of https://github.com/sbt/sbt.git
Merge pull request #7399 from xuwei-k/System-runFinalization
catch `NoSuchMethodError` when call `runFinalization`
This commit is contained in:
commit
c48c1f66de
|
|
@ -37,7 +37,11 @@ private[sbt] object GCUtil {
|
||||||
// Force the detection of finalizers for scala.reflect weakhashsets
|
// Force the detection of finalizers for scala.reflect weakhashsets
|
||||||
System.gc()
|
System.gc()
|
||||||
// Force finalizers to run.
|
// Force finalizers to run.
|
||||||
System.runFinalization()
|
try {
|
||||||
|
System.runFinalization()
|
||||||
|
} catch {
|
||||||
|
case _: NoSuchMethodError =>
|
||||||
|
}
|
||||||
// Force actually cleaning the weak hash maps.
|
// Force actually cleaning the weak hash maps.
|
||||||
System.gc()
|
System.gc()
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue