[
https://issues.apache.org/jira/browse/HBASE-19239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16252103#comment-16252103
]
Andrew Purtell edited comment on HBASE-19239 at 11/14/17 10:03 PM:
-------------------------------------------------------------------
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 are using the wrong type in contains() or as lookup keys
for maps
* 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
* Use AtomicInteger or AtomicLong where 'volatile' on primitive type is
supposed to mean atomic
* Fix infinite loops
* Group operators with parenthesis where expressions are ambiguous or incorrect
* If a method is static, refer to it correctly (with the class, not the
reference)
* 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] [~lhofhansl]
was (Author: apurtell):
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 are using the wrong type in contains() or as lookup keys
for maps
* 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
reference)
* 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] [~lhofhansl]
> 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
>
>
> Fix important findbugs and error-prone warnings on branch-1.4 / branch-1.
> Forward port as appropriate.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)