Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1610

Some classes are using == or != to compare Long/String objects instead of .equals()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.4.5, 3.5.0
    • Fix Version/s: 3.4.6, 3.5.0
    • Component/s: java client, quorum
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The classes org.apache.zookeeper.client.ZooKeeperSaslClient.java and
      org.apache.zookeeper.server.quorum.flexible.QuorumHierarchical.java compare Strings and/or Longs using referential equality.

      Usually, this is not a problem because the Longs are cached and Strings are interned, but I myself had problems with those kind of comparisons in the past because one production JVM didn't reused the objects.

        Attachments

        1. ZOOKEEPER-1610.patch
          2 kB
          Edward Ribeiro
        2. ZOOKEEPER-1610-br34.patch
          1.0 kB
          Patrick Hunt

          Activity

            People

            • Assignee:
              eribeiro Edward Ribeiro
              Reporter:
              eribeiro Edward Ribeiro
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: