-
Enhancement
-
Resolution: Not an Issue
-
P4
-
11, 18
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
the class is a helper for variable row-height in JTable. To perform some search, it computes the mid of some intervall using the expression
int mid = (from + to) / 2; // there are 6 occurences of this in the class
this is prone to intermeditate integer-overflow (the classical error in binary search).
the expression should be written as
int mid = (from + to ) >>> 1;
as in other places in the JDK.
CUSTOMER SUBMITTED WORKAROUND :
keep the JTables small enough
the class is a helper for variable row-height in JTable. To perform some search, it computes the mid of some intervall using the expression
int mid = (from + to) / 2; // there are 6 occurences of this in the class
this is prone to intermeditate integer-overflow (the classical error in binary search).
the expression should be written as
int mid = (from + to ) >>> 1;
as in other places in the JDK.
CUSTOMER SUBMITTED WORKAROUND :
keep the JTables small enough