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

JdbcRowSetImpl(Connection) constructor internally throws NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 5.0
    • core-libs
    • b98
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

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

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Using Firebird SQL database 1.5.1 and Jaybird driver 1.5.5.

      A DESCRIPTION OF THE PROBLEM :
      The JdbcRowSetImpl(java.sql.Connection) constructor
      internally throws (and then handles) a NullPointerException.
      Although the NullPointerException is handled and not passed to the caller,
      this indicates a problem in the JdbcRowSetImpl class and interferes with normal debugging practice (trapping all NullPointerExceptions).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just call the JdbcRowSetImpl(java.sql.Connection) constructor with a valid Connection parameter.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The JdbcRowSetImpl(java.sql.Connection) constructor should not generate and (need to) handle an internal NullPointerException.
      ACTUAL -
      If the debugger is set to trap all NullPointerExceptions, it will trap one inside the
      JdbcRowSetImpl(java.sql.Connection) constructor.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No message and no exception propagated outside the constructor.
      Execute the code below and set debugger to trap all NullPointerExceptions
      (caught and uncaught). I have done this with Eclipse 3.1.0 (build 200412162000).

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.sql.*;
      import javax.sql.rowset.*;
      import com.sun.rowset.*;

      public class TestApp
      { public static void main(String args[])
         { Connection con; JdbcRowSet jdbcRs;
            try
            { Class.forName("org.firebirdsql.jdbc.FBDriver");
               con = DriverManager.getConnection(
                                     "jdbc:firebirdsql:localhost:C:\\database.fdb",
                                     "myName", "myPswd");
               jdbcRs = new JdbcRowSetImpl(con);
               // the line above internally throws and handles NullPointerException
            }
            catch(Exception exc) // NPE not caught, since handled inside constructor
            { System.out.println(exc.getMessage());
            }
         }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Don't trap NullPointerExceptions inside this constructor.
      ###@###.### 2005-2-03 21:05:46 GMT

            ahandasunw Amit Handa (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: