Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8023326

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8
    • 8
    • core-libs
    • None
    • b108

    Description

      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.

      Attachments

        Activity

          People

            msheppar Mark Sheppard
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: