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

javax.sql.rowset.BaseRowSet.setUrl: throws NPE

XMLWordPrintable

    • beta
    • sparc
    • solaris_2.6



      Name: sdR10048 Date: 2003-08-28

      Javadoc DOES specify the expected null reaction.
      No exception should be thrown.
      But code does throw NPE. See demo.
                                                                                      
      Minimized test:
      ===============
      ------- T.java -------
      import javax.sql.rowset.*;
      import javax.sql.*;
                                                                                      
      public class T {
                                                                                      
          public static void main(String[] args) {
              MyBaseRowSet rs = new MyBaseRowSet();
              try {
                  rs.setUrl(null);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
                                                                                      
      class MyBaseRowSet extends BaseRowSet {
                                                                                      
          public MyBaseRowSet() {
              super();
          }
                                                                                      
          public void initParams() {
              super.initParams();
          }
                                                                                      
          public void notifyCursorMoved() {
              super.notifyCursorMoved();
          }
                                                             
          public void notifyRowChanged() {
              super.notifyRowChanged();
          }
                                                                                      
          public void notifyRowSetChanged() {
              super.notifyRowSetChanged();
          }
      }
                                                                                      
      ------- end-of-T.java -------
                                                                                      
      Minimized test output:
      ======================
      java.lang.NullPointerException
              at javax.sql.rowset.BaseRowSet.setUrl(BaseRowSet.java:613)
              at T.main(T.java:9)
                                                                                      
                                                                                      
      Failing Test [s] :
          api/javax_sql/rowset/BaseRowSet/index.html#Options1[BaseRowSet0003]

            ahandasunw Amit Handa (Inactive)
            dsvsunw Dsv Dsv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: