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

The finalize method in JdbcOdbcDriver.java doesn't check for OdbcApi==null

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P5
    • Resolution: Future Project
    • Affects Version/s: 6u10
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_10"
      Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
      Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      The finalize method in JdbcOdbcDriver.java doesn't check for OdbcApi == null before OdbcApi is dereferenced. OdbcApi can be null in cases where a connection cannot be made.
      I realize that the VM will silently ignore the resulting NullPointerException, but the code seems to be wrong.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      This is hard to reproduce since the VM silently ignores NullPointerExceptions in finalize methods.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Check for OdbcApi == null in the finalize method
      ACTUAL -
      No check for OdbcApi == null in the finalize method

      REPRODUCIBILITY :
      This bug can be reproduced occasionally.

        Attachments

          Activity

            People

            Assignee:
            lancea Lance Andersen
            Reporter:
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: