hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Busbey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-13273) Make Result.EMPTY_RESULT read-only; currently it can be modified
Date Fri, 20 Mar 2015 16:50:38 GMT

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

Sean Busbey commented on HBASE-13273:
-------------------------------------

Can someone tell me why TestResult is in hbase-server?

{quote}
-1 findbugs. The patch appears to introduce 1 new Findbugs (version 2.0.3) warnings.
{quote}

I'm not seeing what in hbase-client generated a new warning. I'll chase it down in a bit.

{code}
+  private void checkReadonly() {
+    if (this.readonly == true) {
+      throw new UnsupportedOperationException("Attempting to modify readonly EMPTY_RESULT!");
+    }
+  }
{code}

Please add a javadoc about how all methods that mutate state in a result *must* call this
method.

{code}
+  private void checkReadonly() {
+    if (this.readonly == true) {
+      throw new UnsupportedOperationException("Attempting to modify readonly EMPTY_RESULT!");
+    }
+  }
{code}

just use {{if(readonly)}} directly.

> Make Result.EMPTY_RESULT read-only; currently it can be modified
> ----------------------------------------------------------------
>
>                 Key: HBASE-13273
>                 URL: https://issues.apache.org/jira/browse/HBASE-13273
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.98.0, 1.0.0
>            Reporter: stack
>            Assignee: Mikhail Antonov
>              Labels: beginner
>             Fix For: 2.0.0, 1.0.1, 1.1.0, 0.98.13
>
>         Attachments: HBASE-13273.patch, HBASE-13273.patch, HBASE-13273.patch, HBASE-13273.patch
>
>
> Again from [~larsgeorge]
>     Result result2 = Result.EMPTY_RESULT;
>     System.out.println(result2);
>     result2.copyFrom(result1);
>     System.out.println(result2);
> "What do you think happens when result1 has cells? Yep, you just modified the shared
public EMPTY_RESULT to be not empty anymore."
> Fix. Result should be non-modifiable post-construction.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message