The existence of the "probe" method is a security hole in the
SortDouble abstract class.  As an absolute minimum, any correct
sorting algorithm must examine each element of the array to be sorted
at least once.  But a sorting algorithm should be measured on, among
other things, how many times it really needs to access the values to
compare them, because this may be an expensive operation.  A subclass
of SortDouble could cheat, however, by calling probe only once for
each element of the original array and storing the returned values
into another array internal to the subclass.  The algorithm could then
perform any number of comparisons of the data in the array without
these comparisons getting counted against the algorithm's measured
performance.  This is cheating on the algorithm's metrics because the
person executing the test need not see more probes or comparisons
reported than the number of values in the array.

To fix this security hole, simply remove the "probe" method; to sort
the values of the array, a subclass only needs to know the relative
order between two values, not their actual value, and removing the
"probe" method would prevent the subclass from performing uncounted
comparisons.


It also may seem like a security hole that the SortDouble class does
not check that the values in its curMetrics object do not overflow, as
integral types in Java silently wrap from their maximum (positive)
value to their minimum (negative) value.  For example, a sorting
algorithm could cheat by calling the "swap" method so many
(unnecessary) times that the SortDouble's swapCnt value wraps around
back to zero or some small number, thus fooling a user examining these
values.  But the SortMetrics class used by SortDouble is optimized
against this sort of cheat, since the various "metrics" are stored in
variables of type "long".  A simple test of calling a Java method
10,000,000 times on a 167 MHz 64-bit workstation with the JDK 1.1
takes 1727.3 seconds.  The number of increments required to wrap a
Java "long" variable is 2^64 or 18,446,744,073,709,551,616.
Conservatively assuming a call to swap equivalent to the empty method
call measured above, it would take around 100 million years to cause a
long value to wrap around by calling a method for each increment, on
today's state of the art machines.  It is likely that the person
conducting the sort test would become suspicious of the test long
before it could complete an attempted cheat using this method.
