GitHub user srowen opened a pull request:
https://github.com/apache/spark/pull/18635
[SPARK-21415] Triage scapegoat warnings, part 1
## What changes were proposed in this pull request?
Address scapegoat warnings for:
- BigDecimal double constructor
- Catching NPE
- Finalizer without super
- List.size is O(n)
- Prefer Seq.empty
- Prefer Set.empty
- reverse.map instead of reverseMap
- Type shadowing
- Unnecessary if condition.
- Use .log1p
- Var could be val
In some instances like Seq.empty, I avoided making the change even where
valid in test code to keep the scope of the change smaller. Those issues are
concerned with performance and it won't matter for tests.
## How was this patch tested?
Existing tests
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/srowen/spark Scapegoat1
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18635.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 #18635
----
commit e81ae14f5964ad492a46be611c4395d3e4e2b90b
Author: Sean Owen <[email protected]>
Date: 2017-07-14T07:52:33Z
Address scapegoat warnings for:
BigDecimal double constructor
Catching NPE
Finalizer without super
List.size is O
Prefer Seq.empty
Prefer Set.empty
reverse.map instead of reverseMap
Type shadowing
Unnecessary if condition.
Use .log1p
Var could be val
----
---
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]