OSDN Git Service

HeaderViewListAdapter: Correct thrown error names.
authorTaylor H. Perkins <taylorhp@gmail.com>
Tue, 30 Apr 2013 19:04:52 +0000 (12:04 -0700)
committerTaylor H. Perkins <taylorhp@gmail.com>
Tue, 30 Apr 2013 19:04:52 +0000 (12:04 -0700)
When accessing an invalid entry of the list, an IndexOutOfBounds exception is thrown, not an ArrayIndexOutOfBounds exception.

Change-Id: I3cf59faab004fa6391d84f30f280e0c9bd92dc44
Signed-off-by: Taylor H. Perkins <taylorhp@gmail.com>
core/java/android/widget/HeaderViewListAdapter.java

index 0685e61..222f108 100644 (file)
@@ -145,7 +145,7 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable {
     }
 
     public boolean isEnabled(int position) {
-        // Header (negative positions will throw an ArrayIndexOutOfBoundsException)
+        // Header (negative positions will throw an IndexOutOfBoundsException)
         int numHeaders = getHeadersCount();
         if (position < numHeaders) {
             return mHeaderViewInfos.get(position).isSelectable;
@@ -161,12 +161,12 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable {
             }
         }
 
-        // Footer (off-limits positions will throw an ArrayIndexOutOfBoundsException)
+        // Footer (off-limits positions will throw an IndexOutOfBoundsException)
         return mFooterViewInfos.get(adjPosition - adapterCount).isSelectable;
     }
 
     public Object getItem(int position) {
-        // Header (negative positions will throw an ArrayIndexOutOfBoundsException)
+        // Header (negative positions will throw an IndexOutOfBoundsException)
         int numHeaders = getHeadersCount();
         if (position < numHeaders) {
             return mHeaderViewInfos.get(position).data;
@@ -182,7 +182,7 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable {
             }
         }
 
-        // Footer (off-limits positions will throw an ArrayIndexOutOfBoundsException)
+        // Footer (off-limits positions will throw an IndexOutOfBoundsException)
         return mFooterViewInfos.get(adjPosition - adapterCount).data;
     }
 
@@ -206,7 +206,7 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable {
     }
 
     public View getView(int position, View convertView, ViewGroup parent) {
-        // Header (negative positions will throw an ArrayIndexOutOfBoundsException)
+        // Header (negative positions will throw an IndexOutOfBoundsException)
         int numHeaders = getHeadersCount();
         if (position < numHeaders) {
             return mHeaderViewInfos.get(position).view;
@@ -222,7 +222,7 @@ public class HeaderViewListAdapter implements WrapperListAdapter, Filterable {
             }
         }
 
-        // Footer (off-limits positions will throw an ArrayIndexOutOfBoundsException)
+        // Footer (off-limits positions will throw an IndexOutOfBoundsException)
         return mFooterViewInfos.get(adjPosition - adapterCount).view;
     }