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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Future Project
    • P5
    • None
    • 6u10
    • core-libs

    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

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: