Latest commit e26dac5 Jul 18, 2017 @srowen srowen [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

Author: Sean Owen <sowen@cloudera.com>

Closes #18635 from srowen/Scapegoat1.
Permalink
..
Failed to load latest commit information.
graphx [SPARK-19810][BUILD][CORE] Remove support for Scala 2.10 Jul 13, 2017
ml [SPARK-21415] Triage scapegoat warnings, part 1 Jul 18, 2017
mllib [SPARK-21415] Triage scapegoat warnings, part 1 Jul 18, 2017
pythonconverters [SPARK-14744][EXAMPLES] Clean up examples packaging, remove outdated … Apr 25, 2016
sql [SPARK-19810][BUILD][CORE] Remove support for Scala 2.10 Jul 13, 2017
streaming [SPARK-15208][WIP][CORE][STREAMING][DOCS] Update Spark examples with … Jun 2, 2016
BroadcastTest.scala [MINOR] Issue: Change "slice" vs "partition" in exception messages (a… Apr 9, 2017
DFSReadWriteTest.scala [SPARK-15773][CORE][EXAMPLE] Avoid creating local variable `sc` in ex… Jun 10, 2016
DriverSubmissionTest.scala [SPARK-14444][BUILD] Add a new scalastyle `NoScalaDoc` to prevent Sca… Apr 6, 2016
ExceptionHandlingTest.scala [SPARK-15773][CORE][EXAMPLE] Avoid creating local variable `sc` in ex… Jun 10, 2016
GroupByTest.scala [SPARK-15773][CORE][EXAMPLE] Avoid creating local variable `sc` in ex… Jun 10, 2016
HdfsTest.scala [SPARK-15031][EXAMPLE] Use SparkSession in examples May 20, 2016
LocalALS.scala [SPARK-15398][ML] Update the warning message to recommend ML usage May 20, 2016
LocalFileLR.scala [SPARK-21415] Triage scapegoat warnings, part 1 Jul 18, 2017
LocalKMeans.scala [SPARK-21415] Triage scapegoat warnings, part 1 Jul 18, 2017
LocalLR.scala [SPARK-21415] Triage scapegoat warnings, part 1 Jul 18, 2017
LocalPi.scala [MINOR] Use <= for clarity in Pi examples' Monte Carlo process Nov 2, 2016
LogQuery.scala [SPARK-13583][CORE][STREAMING] Remove unused imports and add checksty… Mar 3, 2016
MultiBroadcastTest.scala [MINOR] Issue: Change "slice" vs "partition" in exception messages (a… Apr 9, 2017
SimpleSkewedGroupByTest.scala [SPARK-15773][CORE][EXAMPLE] Avoid creating local variable `sc` in ex… Jun 10, 2016
SkewedGroupByTest.scala [SPARK-15773][CORE][EXAMPLE] Avoid creating local variable `sc` in ex… Jun 10, 2016
SparkALS.scala [MINOR] Issue: Change "slice" vs "partition" in exception messages (a… Apr 9, 2017
SparkHdfsLR.scala [SPARK-21415] Triage scapegoat warnings, part 1 Jul 18, 2017
SparkKMeans.scala [SPARK-15898][SQL] DataFrameReader.text should return DataFrame Jun 13, 2016
SparkLR.scala [SPARK-21415] Triage scapegoat warnings, part 1 Jul 18, 2017
SparkPageRank.scala [SPARK-16421][EXAMPLES][ML] Improve ML Example Outputs Aug 5, 2016
SparkPi.scala [MINOR] Use <= for clarity in Pi examples' Monte Carlo process Nov 2, 2016
SparkTC.scala [SPARK-15773][CORE][EXAMPLE] Avoid creating local variable `sc` in ex… Jun 10, 2016