Author: rwhitcomb
Date: Mon Feb  1 13:12:12 2016
New Revision: 1727931

URL: http://svn.apache.org/viewvc?rev=1727931&view=rev
Log:
PIVOT-983:  A similar bug was fixed in the VFS File Browser.  The issue
is that the "getRowAt" method of TableView returns -1 if the given
y position is past the end of the data length.  Trying to get row -1
from an ArrayList gives this IllegalArgumentException.  The solution
implemented in the previous fix was simply to check for the -1 row
value and exit early in that case.  So, port that fix to the regular
File Browser.

Modified:
    
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java

Modified: 
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
URL: 
http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java?rev=1727931&r1=1727930&r2=1727931&view=diff
==============================================================================
--- 
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
 (original)
+++ 
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
 Mon Feb  1 13:12:12 2016
@@ -930,7 +930,11 @@ public class TerraFileBrowserSkin extend
                 }
 
                 // Gets the underlying file
-                File file = (File) 
fileTableView.getTableData().get(fileTableView.getRowAt(y));
+                int row = fileTableView.getRowAt(y);
+                if (row < 0) {
+                    return;
+                }
+                File file = (File) fileTableView.getTableData().get(row);
 
                 // Construct and show the tooltip.
                 final Tooltip tooltip = new Tooltip();


Reply via email to