1
0

diplomacy: silence a warning (#560)

This commit is contained in:
Henry Cook 2017-02-22 11:28:04 -08:00 committed by GitHub
parent 45d016a76f
commit 027d6247b6

View File

@ -32,7 +32,7 @@ abstract class LazyModule()(implicit val p: Parameters)
} else if (classOf[Seq[LazyModule]].isAssignableFrom(m.getReturnType)) { } else if (classOf[Seq[LazyModule]].isAssignableFrom(m.getReturnType)) {
val obj = m.invoke(this) val obj = m.invoke(this)
if (obj eq null) Seq() else { if (obj eq null) Seq() else {
val seq = try { obj.asInstanceOf[Seq[Object]] } catch { case _ => null } val seq = try { obj.asInstanceOf[Seq[Object]] } catch { case _: Throwable => null }
if (seq eq null) Seq() else { if (seq eq null) Seq() else {
seq.zipWithIndex.map { case (l, i) => (m.getName + "_" + i, l) } seq.zipWithIndex.map { case (l, i) => (m.getName + "_" + i, l) }
} }