hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nkeywal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-8101) Cleanup: findbugs and javadoc warning fixes as well as making it illegal passing null row to Put/Delete, etc.
Date Thu, 14 Mar 2013 10:40:13 GMT

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

nkeywal commented on HBASE-8101:

+  public int hashCode() {
+    // TODO: This is wrong.  Can't have two gets the same just because on same row.  But
+    // matches how equals works currently and gets rid of the findbugs warning.
+    return this.getRow().hashCode();
+  }
=> You shouldn't call hashCode on an array, you could call java.util.Arrays.hashCode

+  public Increment(final byte [] row, final int offset, final int length) {
+    if (row == null || length <= 0 || length > HConstants.MAX_ROW_LENGTH) {
       throw new IllegalArgumentException("Row key is invalid");
=> When it happens in production, I like to have the actual values (i.e. row= offset= &
so on ;-)    

+    value="CN_IDIOM_NO_SUPER_CALL",
+    justification="Its PITA calling the super.clone")
=> There is a good reason for this warning: subclasses won't be able to call super.clone
themselves if we do that (the type will be wrong: the object.clone creates the right object).
As it's private (i.e. we don't offer a public API that should be subclassed I guess it's acceptable.
At the very least we should put a warning in the justification.

+1 otherwise, thanks for doing this!
> Cleanup: findbugs and javadoc warning fixes as well as making it illegal passing null
row to Put/Delete, etc.
> -------------------------------------------------------------------------------------------------------------
>                 Key: HBASE-8101
>                 URL: https://issues.apache.org/jira/browse/HBASE-8101
>             Project: HBase
>          Issue Type: Sub-task
>          Components: IPC/RPC
>            Reporter: stack
>             Fix For: 0.95.0
>         Attachments: 8101.txt, 8101v2.txt
> Part of hbase-7900 broken out so that patch gets smaller.  This is a patch with cleanup
mostly findbugs fixes (general ones) as well as adding check for null row being passed to
Put, Get, etc.  This patch helps rpc along.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message