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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: 8
    • Component/s: core-libs
    • None
    • b108

      Test contains:

      Server s = null;
      try {
          s = new Server();
          s.startServer();
         ...
      } finally {
          s.stopServer();
      }

      If "new Server() throws an exception we hit the finally block, s is still null and we then throw NullPointerException instead of the real exception.

      The try block should at least start after "s = new Server();" and possibly after startServer() as well.

            Assignee:
            Mark Sheppard
            Reporter:
            David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: