RFR: 8023326 [TESTBUG] java/net/CookieHandler/LocalHostCookie.java misplaced try/finally

Kurchi Subhra Hazra kurchisubhra at gmail.com
Wed Aug 21 11:23:31 PDT 2013


I guess we could have changed class Server to implement AutoCloseable too,
but this looks fine to me.

Thanks,
- Kurchi


On Wed, Aug 21, 2013 at 6:37 AM, Mark Sheppard <mark.sheppard at oracle.com>wrote:

> Hi
> please oblige and review the fix below to address the issue in JDK-8023326
> which makes the test more robust to certain exceptions thrown.
>
> http://cr.openjdk.java.net/~**msheppar/8023326/webrev/<http://cr.openjdk.java.net/~msheppar/8023326/webrev/>
>
> regards
> Mark
>
> --- old/test/java/net/**CookieHandler/LocalHostCookie.**java        Wed
> Aug 21 12:23:21 2013
> +++ new/test/java/net/**CookieHandler/LocalHostCookie.**java        Wed
> Aug 21 12:23:21 2013
> @@ -72,7 +72,9 @@
>                  }
>              }
>          } finally {
> -            s.stopServer();
> +            if (s != null) {
> +                s.stopServer();
> +            }
>          }
>      }
>  @@ -96,7 +98,9 @@
>          }
>           public void stopServer() {
> -            server.stop(0);
> +            if (server != null) {
> +                server.stop(0);
> +            }
>          }
>      }
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/net-dev/attachments/20130821/7180739e/attachment.html 


More information about the net-dev mailing list