GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/12495
[MINOR] Use getOrElse(null) which can simply be orNull for Option.
## What changes were proposed in this pull request?
Currently, it looks `getOrElse(null)` is being used which just can be
`orNull` sparsely for `Option`.
It looks [`orNull` calls `getOrElse(null)`
internally](https://github.com/scala/scala/blob/99a82be91cbb85239f70508f6695c6b21fd3558c/src/library/scala/Option.scala#L120-L132).
So, using `orNull` instead of `getOrElse(null)` might be cleaner and simpler
which calls the same logics.
## How was this patch tested?
`sbt scalastyle` was used.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark getorelse-ornull
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12495.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12495
----
commit c2a46097db8a8ef67c6069c04a52165f5a2d8e54
Author: hyukjinkwon <[email protected]>
Date: 2016-04-19T10:11:38Z
Use getOrElse(null) which can simply be orNull
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]