Sylvain Wallez wrote: > > . . . > Another related item : while updating the ParanoidClassloader to make it > really paranoid, I encountered an inconsistency in java.lang.ClassLoader > class : getResource() can be overriden, but getResources() is declared > final, meaning there is no way to change the order in which e.g. > indentical service definitions in META-INF/services are enumerated. > Although this shouldn't cause a problem with JAXP (at least the Apache > implementation) which uses getResource() (no enumeration), we should be > aware that this is a potential pitfall.
This isn't an inconsistency, it's intentional -- getResources() is a final method that calls findResources, a protected method on the current instance of the ClassLoader. ClassLoader implementations should override findResources(). The purpose of getResources() is to get a set of resources from all the classloaders in the classloader heirarchy. > > > As this item impacts one of the core classes of the JDK, it may be > difficult to convice people to fix it, but this would allow to uniformly > override the search order in specialized classloaders. > > Sylvain David --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]