[jsr294-modularity-eg] Strawman for the reflective API
Andreas Sterbenz
Andreas.Sterbenz at Sun.COM
Mon Jul 16 16:40:14 EDT 2007
Glyn Normington wrote:
>
> Assuming ClassLoader.findSuperpackage is not private, how will it
> guarantee to function correctly if application code calls it? The
> scenario I have in mind is two threads calling the same class loader
> object to find the same superpackage.
The findSuperpackage() method should only ever be called by the JVM [1].
Because it is declared 'protected', it is not possible for application
code to call it at all. It could only be called by a ClassLoader
implementation (or code in the same package). That would be a developer
error and I expect is likely to be caught in testing.
Andreas.
[1] if we think there is a use case for Java code needing to obtain the
Superpackage object for a given name, we should add the
Superpackage.forName() method I mentioned earlier.
More information about the jsr294-modularity-eg
mailing list