[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] small fix for ServerSocket close
From: |
Michael Koch |
Subject: |
Re: [PATCH] small fix for ServerSocket close |
Date: |
Wed, 19 Nov 2003 14:13:09 +0100 |
User-agent: |
Mutt/1.3.28i |
On Thu, Nov 13, 2003 at 03:35:47PM +0100, Dalibor Topic wrote:
> Hi all,
>
> attached is a small fix for ServerSocket's close method. It fixes a
> NullPointerException when attempting to close a ServerSocket twice.
>
> 2003-11-13 Guilhem Lavaux <address@hidden>
> * java/net/ServerSocket.java:
> (close) Check if server socket has already been released,
> before attepting to close it.
>
> --- /var/tmp/PROJECTS/classpath//./java/net/ServerSocket.java Fri Oct 17
> 19:05:29 2003
> +++ java/net/ServerSocket.java Wed Oct 22 21:32:21 2003
> @@ -339,7 +339,8 @@
> */
> public void close () throws IOException
> {
> - impl.close ();
> + if (impl != null)
> + impl.close ();
>
> if (getChannel() != null)
> getChannel().close ();
After thinking about this patch, its more and more bogus in my eyes as
impl never may be null. I provided a better fix to libgcj. When its
approved I will merge it into classpath too.
What would really interest me is the testcase from Guilhem that
triggered this.
Michael