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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.4.5, 3.5.0
    • 3.4.6, 3.5.0
    • java client, quorum
    • None
    • 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-br34.patch
          1.0 kB
          Patrick D. Hunt
        2. ZOOKEEPER-1610.patch
          2 kB
          Edward Ribeiro

        Activity

          People

            eribeiro Edward Ribeiro
            eribeiro Edward Ribeiro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: