On 21/06/2017 09:27, Hamlin Li wrote:
:
Besides of it, I have some minor comments about the doc:
In section "Timing of provider discovery", it says as below:
Each invocation of the|iterator|method returns an|Iterator|that first
yields all of the elements cached from previous iteration, in
**instantiation order**, and then lazily locates and instantiates any
remaining providers, adding each one to the cache in turn.
But in API doc for iterator(), it says:
Caching: The iterator returned by this method first yields all of the
elements of the provider cache, in **the order that they were loaded**
There is an inconsistency here, it would be clearer to say that it's the
order that they were loaded and instantiated. This wording has been
there since Java SE 6 but I agree it all needs to be re-examined. So at
some point there will be another big update to the ServiceLoader javadoc
but more likely to be for Java SE 10 given that JDK 9 is at GAC this week.
-Alan