javax.sql.rowset.RowSetMetaDataImpl.setColumnCount: MAX_VALUE

XMLWordPrintable

    • beta
    • sparc
    • solaris_2.6



      Name: sdR10048 Date: 09/01/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b16"
      JCK : 1.5
      Platform[s] : Solaris
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] :
      api/javax_sql/rowset/RowSetMetaDataImpl/index.html#ColumnCount[RowSetMetaDataImpl2002]


      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public void setColumnCount(int columnCount)
                          throws java.sql.SQLException
      Sets the number of columns in the RowSet object for which this RowSetMetaDataImpl object was created to the given number.

      Specified by:
      setColumnCount in interface javax.sql.RowSetMetaData
      Parameters:
      columnCount - number of columns in the RowSet object
      Throws:
      java.sql.SQLExceptionpublic void setColumnCount(int columnCount)
                          throws java.sql.SQLException
      Sets the number of columns in the RowSet object for which this RowSetMetaDataImpl object was created to the given number.

      Specified by:
      setColumnCount in interface javax.sql.RowSetMetaData
      Parameters:
      columnCount - number of columns in the RowSet object
      Throws:
      java.sql.SQLException
      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      RowSetMetaDataImpl throws NegativeArraySizeException in case 'columnCount' ==
      Integer.MAX_VALUE; If this is expected behaviour this should be specified in javadoc.
      See Demo.

          
      Minimized test:
      ===============
      ------- T.java -------
      import javax.sql.rowset.*;
      import java.sql.*;

      public class T {

          public static void main(String[] args) {
              RowSetMetaDataImpl meta = new RowSetMetaDataImpl();
              try {
                  meta.setColumnCount(Integer.MAX_VALUE);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }

      ------- end-of-T.java -------

      Minimized test output:
      ======================
      import javax.sql.rowset.*;
      import java.sql.*;

      public class T {

          public static void main(String[] args) {
              RowSetMetaDataImpl meta = new RowSetMetaDataImpl();
              try {
                  meta.setColumnCount(Integer.MAX_VALUE);
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }

      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: