Permalink
Browse files

Rollback the Spiewak suggested getAs changs. They break a lot of

behavior especially boxing.
  • Loading branch information...
Brendan W. McAdams
Brendan W. McAdams committed Jun 23, 2012
1 parent 6320547 commit b6fe3a95637b7d33aade0754188aeddf8e09a49c
Showing with 1 addition and 5 deletions.
  1. +1 −5 casbah-commons/src/main/scala/MongoDBObject.scala
@@ -113,11 +113,7 @@ class MongoDBObject(val underlying: DBObject = new BasicDBObject) extends Map[St
def getAs[A : NotNothing : Manifest](key: String): Option[A] = {
underlying.get(key) match {
case null => None
- case value if manifest[A] >:> Manifest.classType(value.getClass) =>
- Some(value.asInstanceOf[A])
- case fail =>
- throw new IllegalArgumentException("Unable to cast '%s' as '%s'; please check your types.".format(Manifest.classType(fail.getClass), manifest[A]))
- None
+ case value => Some(value.asInstanceOf[A])
}
}

0 comments on commit b6fe3a9

Please sign in to comment.