RFR 8014076: Arrays parallel and serial sorting improvements

Chris Hegarty chris.hegarty at oracle.com
Wed May 8 21:26:53 UTC 2013


On 8 May 2013, at 21:56, Mike Duigou <mike.duigou at 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?

-Chris

> 
> Mike
> 



More information about the core-libs-dev mailing list