While testing Mauve exception handling I tried to generate a NPE using
JTable.columnAtPoint but found that Classpath was gracefully ignoring
null argument while Sun was throwing the NPE I wanted.  So I removed
the != null check.

2006-03-21  Anthony Balkissoon  <[EMAIL PROTECTED]>

        * javax/swing/JTable.java:
        (columnAtPoint): Removed the null check, this method should throw a NPE
        if the argument is null.

--Tony
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTable.java,v
retrieving revision 1.89
diff -u -r1.89 JTable.java
--- javax/swing/JTable.java	20 Mar 2006 11:26:04 -0000	1.89
+++ javax/swing/JTable.java	21 Mar 2006 18:40:07 -0000
@@ -1946,21 +1946,18 @@
    */
   public int columnAtPoint(Point point)
   {
-    if (point != null)
-      {
-        int ncols = getColumnCount();
-        Dimension gap = getIntercellSpacing();
-        TableColumnModel cols = getColumnModel();
-        int x = point.x;
+    int ncols = getColumnCount();
+    Dimension gap = getIntercellSpacing();
+    TableColumnModel cols = getColumnModel();
+    int x = point.x;
 
-        for (int i = 0; i < ncols; ++i)
-          {
-            int width = cols.getColumn(i).getWidth()
-                        + (gap == null ? 0 : gap.width);
-            if (0 <= x && x < width)
-              return i;
-            x -= width;
-          }
+    for (int i = 0; i < ncols; ++i)
+      {
+        int width = cols.getColumn(i).getWidth()
+                    + (gap == null ? 0 : gap.width);
+        if (0 <= x && x < width)
+          return i;
+        x -= width;
       }
     return -1;
   }
@@ -1969,8 +1966,7 @@
    * Returns index of the row that contains specified point or -1 if this table
    * doesn't contain this point.
    * 
-   * @param point
-   *          point to identify the row
+   * @param point point to identify the row
    * @return index of the row that contains specified point or -1 if this table
    *         doesn't contain this point.
    */

Reply via email to