[hg] main-silver: Assure that equals() does not return true when...

  • From:
  • To:
  • Subject: [hg] main-silver: Assure that equals() does not return true when...
  • Date: Thu, 19 Sep 2013 05:30:35 -0700

changeset 9c5a5c7c4720 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/9c5a5c7c4720
description:
        Assure that equals() does not return true when hash codes differ.

diffstat:

 
debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/WeakHashMapActive.java
 |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (13 lines):

diff --git 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/WeakHashMapActive.java
 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/WeakHashMapActive.java
--- 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/WeakHashMapActive.java
+++ 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/WeakHashMapActive.java
@@ -135,6 +135,9 @@
             KeyReference kr = (KeyReference) obj;
             K k1 = get();
             Object k2 = kr.get();
+            if (k1 == null && k2 == null) {
+                return hash == kr.hash;
+            }
             return (k1 == k2 || (k1 != null && k1.equals(k2)));
         }
 

[hg] main-silver: Assure that equals() does not return true when...

mentlicher 09/19/2013

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close