On 05/08/13 17:26, Chris Hegarty wrote:
On 8 May 2013, at 21:56, Mike Duigou <mike.dui...@oracle.com> wrote:
On May 7 2013, at 10:13 , Chris Hegarty wrote:
On 05/07/2013 05:04 PM, Mike Duigou wrote:
The "currently" MIN_ARRAY_SORT_GRAN statement bothers me. Can we remove
currently?
No problem. That would read...
"When the sub-array length reaches a {@linlplain #MIN_ARRAY_SORT_GRAN
minimum granularity}, the sub-array is sorted using the appropriate
Arrays.sort method."
linlplain -> linkplain
I would expect to see currently if the numerical value of MIN_ARRAY_SORT_GRAN
was presented. We may change the threshold but we're otherwise committed to the
constant name for the threshold.
I really don't care much for MIN_ARRAY_SORT_GRAN. I left it out from the
original push, then flip flopped a few times on it. I don't like {@value}, as
the field would still need to be public, but not referenced in the docs. I
could be persuaded to go either way on it, but it is not worth spending time on.
One other issue with MIN_ARRAY_SORT_GRAN is that, according to separate
compilation rules, as a static final int the value of MIN_ARRAY_SORT_GRAN
can/will be compiled into code. The value isn't thereafter changeable except by
recompiling everything which references it. In particular, injecting a
different value into Arrays.MIN_ARRAY_SORT_GRAN would likely have no effect at
runtime. This situation seems a little strange/unhelpful to me. It wouldn't
even be practically changeable between releases since code compiled with Java
8 would keep using that value even when running on future versions with a
different value for MIN_ARRAY_SORT_GRAN.
Good point Mike. I guess the same argument could be made for putting any value
in the implementation detail. Any objection to completely removing any
reference to this?
I agree that making it non-public is fine. Somewhere though there should
be a note saying that a "parallel" sort might not actually use multiple
threads because there are too few elements.
-Doug