Controller ensureInLayer is slow when using addReads/addOpens for Layers with large numbers of modules

Alan Bateman Alan.Bateman at oracle.com
Thu Mar 9 16:14:30 UTC 2017


On 09/03/2017 16:09, Thomas Watson wrote:

> :
>
> Sorry, my mail system adds stuff that the mailing list doesn't like, 
> let me try this again:
>
> The Controller ensureInLayer method has this.
>
>         private void ensureInLayer(Module source) {
>
>             if (!layer.modules().contains(source))
>
> throw new IllegalArgumentException(source + " not in layer");
>
>         }
>
> The implementation of Layer.modules() is terribly expensive when 
> trying to collect the complete set of modules only to perform a 
> contains check.
I agree, we can trivially fix this, it just wasn't noticed before.

-Alan



More information about the jigsaw-dev mailing list