directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r433488 - in /directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe: AnonymousVmPipeAddress.java VmPipeConnector.java
Date Tue, 22 Aug 2006 03:37:02 GMT
Author: trustin
Date: Mon Aug 21 20:37:01 2006
New Revision: 433488

URL: http://svn.apache.org/viewvc?rev=433488&view=rev
Log:
Fixed issue: DIRMINA-240 (VmPipeConnectors hands out non-unique AnonymousSocketAddresses)

Modified:
    directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/AnonymousVmPipeAddress.java
    directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java

Modified: directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/AnonymousVmPipeAddress.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/AnonymousVmPipeAddress.java?rev=433488&r1=433487&r2=433488&view=diff
==============================================================================
--- directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/AnonymousVmPipeAddress.java
(original)
+++ directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/AnonymousVmPipeAddress.java
Mon Aug 21 20:37:01 2006
@@ -15,27 +15,21 @@
 {
     private static final long serialVersionUID = 3258135768999475512L;
 
-	static final AnonymousVmPipeAddress INSTANCE = new AnonymousVmPipeAddress();
-
     /**
      * Creates a new instance with the specifid port number.
      */
-    private AnonymousVmPipeAddress()
+    public AnonymousVmPipeAddress()
     {
     }
 
     public int hashCode()
     {
-        return 1432482932;
+        return System.identityHashCode( this );
     }
 
     public boolean equals( Object o )
     {
-        if( o == null )
-            return false;
-        if( this == o )
-            return true;
-        return o instanceof AnonymousVmPipeAddress;
+	return this == o;
     }
 
     public int compareTo( Object o )
@@ -45,6 +39,6 @@
 
     public String toString()
     {
-        return "vm:anonymous";
+        return "vm:anonymous(" + hashCode() + ')';
     }
 }

Modified: directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java?rev=433488&r1=433487&r2=433488&view=diff
==============================================================================
--- directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java
(original)
+++ directory/branches/mina/0.8/src/java/org/apache/mina/protocol/vmpipe/VmPipeConnector.java
Mon Aug 21 20:37:01 2006
@@ -68,7 +68,7 @@
             throw new IOException( "Endpoint unavailable: " + address );
 
         VmPipeSession session = new VmPipeSession( new Object(), // lock
-                                                   AnonymousVmPipeAddress.INSTANCE,
+                                                   new AnonymousVmPipeAddress(),
                                                    filterChain,
                                                    protocolProvider.getHandler(),
                                                    entry );



Mime
View raw message