Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-1400

Bad attempt to compute absolute value of signed 32-bit hashcode. Condition.await() not in loop. Field isn't final but should be.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 3.1
    • 3.0.1
    • Low

      Bad attempt to compute absolute value of signed 32-bit hashcode. If the hashcode is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). Fix: Math.abs(Integer.MIN_VALUE & FFFFFFF0), removing -2^31 as a possibility. At PartitionedHashMap.java:[line 457] in method org.jgroups.blocks.PartitionedHashMap$ConsistentHashFunction.viewAccepted(View)

      Condition.await() not in loop. If the object is used for multiple conditions, the condition the caller intended to wait for might not
      be the one that actually occurred. Fix: Put the if statement in a while loop. At locking.java:[line 186] in method org.jgroups.protocols.Locking.down(Event)

      Field isn't final but should be. A mutable static field could be changed by malicious code or by accident from another package.
      Fix: Made the field final. At PartitionedHashMap.java:[line74] Field org.jgroups.blocks.PartitionedHashMap.methods

              rhn-engineering-bban Bela Ban
              dwestbro9 David Westbrook (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: