hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Purtell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-19239) Fix findbugs and error-prone warnings
Date Tue, 14 Nov 2017 20:13:00 GMT

    [ https://issues.apache.org/jira/browse/HBASE-19239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16252103#comment-16252103

Andrew Purtell commented on HBASE-19239:

This is turning in to a lot of work. I'm going to plow through it. I should be done today.

Here is what I am fixing:

* Fix important or scary findbugs warnings, especially probable null dereferences and object
monitor antipatterns. Suppress warnings where appropriate.
* Fix places where we do byte[].toString
* Fix places where we test for reference equality - this is almost always wrong
* Fix classes that override equals or hashCode but not both
* Add override annotations where missing so the compiler can help us catch API change problems
* Group operators with parenthesis where expressions are ambiguous or incorrect
* If a method is static, refer to it correctly (with the class, not the object)
* Fix where we shadow a field from the parent in the subclass. This can be super confusing.
* getDeclaredConstructor().newInstance() instead of just newInstance()
* Make inner classes static wherever possible
* Fix bad uses of Math.abs(), especially in conjunction with Random
* Fix bad null checks in protobuf code - protobuf get() methods for lists never return null
* Explicit casts for narrowing
* Specify UTF_8 charset for string to byte[] conversions and vice versa, don't rely on default.

Patches will be for branch-1.

I'll forward port to branch-2 / master. Some hunks will apply. Rejects can be assumed to need
a new analysis. I'll do that new analysis. 

The changes should not be controversial and so I plan to commit them as long as all unit tests
continue to pass. I will put up patches here and on reviewboard and solicit feedback but there
will be hundreds of hunks so I don't expect humans to do a detailed review. I do expect someone
will want to do a pass over the deltas as a sanity check, but if nobody wants to do this,
that is fine with me. Let me know. Commit targets are: branch-1.4, branch-1, branch-2, master.

FYI [~stack] [~mdrob]

> Fix findbugs and error-prone warnings
> -------------------------------------
>                 Key: HBASE-19239
>                 URL: https://issues.apache.org/jira/browse/HBASE-19239
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Andrew Purtell
>            Assignee: Andrew Purtell
>             Fix For: 3.0.0, 1.4.0, 2.0.0-beta-1
>         Attachments: 0001-HBASE-19239-Fix-findbugs-and-error-prone-issues.patch, 0002-HBASE-19239-Fix-findbugs-and-error-prone-issues.patch,
0003-HBASE-19239-Fix-findbugs-and-error-prone-issues.patch, 0004-HBASE-19239-Fix-findbugs-and-error-prone-issues.patch,
0005-HBASE-19239-Fix-findbugs-and-error-prone-issues.patch, error-prone-branch-1.4.txt
> Fix important findbugs and error-prone warnings on branch-1.4 / branch-1. Forward port
as appropriate. 

This message was sent by Atlassian JIRA

View raw message