GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/11530
[SPARK-13692] Fix trivial Coverity/Checkstyle defects
## What changes were proposed in this pull request?
This issue fixes the following potential bugs and Java coding style
detected by Coverity and Checkstyle.
- Implement both null and type checking in equals functions.
- Fix wrong type casting logic in SimpleJavaBean2.equals.
- Add `implement Cloneable` to `UTF8String` and `SortedIterator`.
- Remove dereferencing before null check in `AbstractBytesToBytesMapSuite`.
- Fix coding style: Add '{}' to single `for` statement in mllib examples.
- Remove unused imports in `ColumnarBatch`.
Please note that the last two checkstyle errors exist on newly added
commits after [SPARK-13583](https://issues.apache.org/jira/browse/SPARK-13583).
## How was this patch tested?
manual via `./dev/lint-java` and Coverity site.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-13692
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11530.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 #11530
----
commit 9f74e82c81e4677ea3dd8e2985088c958f90ebcf
Author: Dongjoon Hyun <[email protected]>
Date: 2016-03-04T22:56:42Z
Fix potential bugs and Java coding style.
* Implement both null and type checking in equals functions.
* Fix wrong type casting logic in SimpleJavaBean2.equals.
* Add `implement Cloneable` to `UTF8String` and `SortedIterator`.
* Remove dereferencing before null check in
`AbstractBytesToBytesMapSuite`.
* Fix coding style: Add '{}' to single `for` statement in mllib examples.
* Remove unused imports in `ColumnarBatch`.
----
---
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]