On Fri, Aug 12, 2011 at 9:06 AM, Rémi Forax <[email protected]> wrote: > On 08/12/2011 02:46 PM, [email protected] wrote: >> >> Hi Remi, >> Your argument is flawed >> >> The complexity of the operations is not defined by the interface or the >> presence or absence of the interface > > In theory yes, but in practice ... > What is the purpose of java.util.RandomAccess ? > >> If you have complexity algo checks then these can only be applied to known >> classes where the complexity is defined in the interface or class >> >> As such the code that infers this behaviour is broken and needs to be >> fixed. > > Ok, how to remove the instanceof RandomAccess in Collections.shuffle (by > example).
Does anyone know if there has ever been a proposal or experiments to use annotations to provide algorithmic complexity information for a given method implementation? This might be an interesting experiment rather than adding marker interfaces that apply to an entire class. - Dave
