harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r817167 - /harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectionKeyImpl.java
Date Mon, 21 Sep 2009 06:03:56 GMT
Author: regisxu
Date: Mon Sep 21 06:03:54 2009
New Revision: 817167

URL: http://svn.apache.org/viewvc?rev=817167&view=rev
Log:
Apply patch for HARMONY-6312: Concurrency problems in NIO

remove SelectionKeyImpl.hasCode/equals, the old implementation is not thread-safe

Modified:
    harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectionKeyImpl.java

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectionKeyImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectionKeyImpl.java?rev=817167&r1=817166&r2=817167&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectionKeyImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectionKeyImpl.java
Mon Sep 21 06:03:54 2009
@@ -40,30 +40,12 @@
 
     private int index;
 
-    private int hashCode;
-
-    public int hashCode() {
-        return hashCode;
-    }
-
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        final SelectionKeyImpl other = (SelectionKeyImpl) obj;
-        return hashCode == other.hashCode;
-    }
-
     public SelectionKeyImpl(AbstractSelectableChannel channel, int operations,
             Object attachment, SelectorImpl selector) {
         super();
         this.channel = channel;
         interestOps = operations;
         this.selector = selector;
-        this.hashCode = stHash++;
         attach(attachment);
     }
 



Mime
View raw message