scala/scala — pull request #4217 by enisher (2014-12-18 22:29:57+00:00)
Title: Prevent creation of Some(null) with Option.map function

Current implementation of Option.map don't allow to simplify checks for nulls.

If I have something like `project.getUser.getAccount.getName` and need to prevent nullpointer exceptions I would write something like
```scala
Option(project).map(_.getUser).map(_.getAccount).map(_.getName).orElse("Default name")
```
But the function is implemented in a way that lead to null pointer exceptions in this case.