[kaffe] AbstractSelector.java:cancelledKeys() - small patch for Freenet

David 'Bombe' Roden bombe at todesbaum.de
Mon Oct 6 08:30:03 PDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi.

I made a small patch that kind of improves kaffe's ability to run Freenet.

In the 1.4 docs there is no clue about whether cancelledKeys() should
return null or an empty set if there are no cancelled keys and I don't
have any nio-knowledge to construct a small test program for checking
what SUN's JDK does. I hope this proves useful, anyway.


diff -u -3 -p -u -w -r1.2 AbstractSelector.java
- --- libraries/javalib/java/nio/channels/spi/AbstractSelector.java
10 Aug 2003 18:47:54 -0000      1.2
+++ libraries/javalib/java/nio/channels/spi/AbstractSelector.java
6 Oct 2003 15:24:19 -0000
@@ -41,6 +41,7 @@ package java.nio.channels.spi;
 import java.io.IOException;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.Selector;
+import java.util.Collections;
 import java.util.Set;

 public abstract class AbstractSelector extends Selector
@@ -101,7 +102,7 @@ public abstract class AbstractSelector e

   protected final Set cancelledKeys()
   {
- -    return null;
+    return Collections.EMPTY_SET;
   }

   /**


- --
WWW: http://www.todesbaum.de/ | IRC: Bombe | ICQ: 3017094

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQE/gYi3sh8Hgp5TwkMRAuNwAKCrBtuuDxPitb3Wqyz11oO0mlcGKACfef7d
VO0DPpgyp05/ws+/KrZtqXU=
=k/JB
-----END PGP SIGNATURE-----





More information about the kaffe mailing list