hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-11828) callers of SeverName.valueOf should use equals and not ==
Date Wed, 27 Aug 2014 03:52:59 GMT

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

Hudson commented on HBASE-11828:
--------------------------------

SUCCESS: Integrated in HBase-1.0 #128 (See [https://builds.apache.org/job/HBase-1.0/128/])
HBASE-11828 callers of SeverName.valueOf should use equals and not ==. (apurtell: rev 2ef6d03e56c374ef56ddcee5f87e7f7a77c9337f)
* hbase-client/src/main/java/org/apache/hadoop/hbase/ServerName.java


> callers of SeverName.valueOf should use equals and not ==
> ---------------------------------------------------------
>
>                 Key: HBASE-11828
>                 URL: https://issues.apache.org/jira/browse/HBASE-11828
>             Project: HBase
>          Issue Type: Improvement
>          Components: Client
>            Reporter: Sean Busbey
>            Assignee: Sean Busbey
>            Priority: Minor
>              Labels: documentation
>             Fix For: 0.99.0, 2.0.0, 0.98.6
>
>         Attachments: HBASE-11828.patch
>
>
> ServerName.valueOf is missing docs about the safety of using == vs .equals on returned
members.
> For clarity, we should specify that users are expected to use .equals even though we
may return shared immutable instances. The .equals method short circuits on object equality,
so the cost difference in the positive case is 1 function call.
> Current behavior is to return a new instance on each call (0.96, 0.98, branch-1, master).
So presumably any current users are either doing this or they have a bug.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message