According to the documentation:
When this method is first called, it creates a single new pseudorandom-number generator, exactly as if by the expression
new java.util.RandomThis new pseudorandom-number generator is used thereafter for all calls to this method and is used nowhere else.
I’m confused as to the scope of ‘When this method is first called” – is it when my application first calls it? Is it only ever seeded once no matter what my application does?
When it is first called in your JVM (by any code).
It’s doing an (unsafe – see link below) lazy initialization of a singleton:
by calling:
EDIT Note that this code is not thread safe. Official bug: https://bugs.java.com/bugdatabase/view_bug?bug_id=6470700