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

DefaultTableColumnModel.getColumn() method should mention ArrayIndexOutOfBoundsException

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 19
    • client-libs
    • None
    • behavioral
    • minimal
    • doc change - no code is modified
    • Java API
    • SE

      Summary

      DefaultTableColumnModel.getColumn(int columnIndex) method throws ArrayIndexOutOfBoundsException but it is not mentioned in the javadoc which needs to be rectified.

      Problem

      DefaultTableColumnModel.getColumn(int columnIndex) method throws ArrayIndexOutOfBoundsException when columnIndex is not in the valid range: (< 0 or >= getColumnCount()) but is not mentioned in the spec.

      Solution

      Javadoc should mention that it throws ArrayIndexOutOfBoundsException.

      Specification

      src/java.desktop/share/classes/javax/swing/table/DefaultTableColumnModel.java

            *
            * @param   columnIndex     the index of the column desired
            * @return  the <code>TableColumn</code> object for the column
            *                          at <code>columnIndex</code>
      +     * @exception  ArrayIndexOutOfBoundsException if <code>columnIndex</code>
      +     *             is out of range:
      +     *             (<code>columnIndex &lt; 0 || columnIndex &gt;= getColumnCount()</code>)
            */
           public TableColumn getColumn(int columnIndex) {

            psadhukhan Prasanta Sadhukhan
            aglasman Alexander Glasman (Inactive)
            Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: