You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Sean Busbey (JIRA)" <ji...@apache.org> on 2014/08/26 18:27:57 UTC

[jira] [Created] (HBASE-11828) callers of SeverName.valueOf should use equals and not ==

Sean Busbey created HBASE-11828:
-----------------------------------

             Summary: 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


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)