Permalink
Browse files

set the type with toArray instead of using asInstanceOf

  • Loading branch information...
1 parent cd0a2c4 commit af7ec7467c53b840e7326ef8501dcb8153fe76f0 @sprsquish sprsquish committed Mar 3, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/scala/com/twitter/gizzard/nameserver/NameServer.scala
@@ -159,8 +159,8 @@ class NameServer[S <: shards.Shard](
def findForwardings(tableId: Int) = {
if(forwardings == null) throw new NameserverUninitialized
forwardings.get(tableId).flatMap { bySourceIds =>
- val shards = bySourceIds.values.toArray.map { shardInfo =>
- findShardById(shardInfo.asInstanceOf[ShardInfo].id)
+ val shards = bySourceIds.values.toArray(Array[ShardInfo]()).map { shardInfo =>
+ findShardById(shardInfo.id)
}
Some(shards)
} getOrElse {

0 comments on commit af7ec74

Please sign in to comment.