On 9 April 2011 23:48, <simonetrip...@apache.org> wrote: > Author: simonetripodi > Date: Sat Apr 9 22:48:40 2011 > New Revision: 1090700 > > URL: http://svn.apache.org/viewvc?rev=1090700&view=rev > Log: > DISCOVERY-13: Problem with Oracle JVM classLoader
[...] > > Modified: > commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/classes/DiscoverClasses.java > URL: > http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/classes/DiscoverClasses.java?rev=1090700&r1=1090699&r2=1090700&view=diff > ============================================================================== > --- > commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/classes/DiscoverClasses.java > (original) > +++ > commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/resource/classes/DiscoverClasses.java > Sat Apr 9 22:48:40 2011 > @@ -99,9 +99,15 @@ public class DiscoverClasses<T> extends > ClassLoader loader = getClassLoaders().get(idx++); > > URL url = null; > + boolean getResourceUnsupported = false; > + > try { > url = loader.getResource(resourceName); > } catch (UnsupportedOperationException e) { > + getResourceUnsupported = true; > + } > + > + if (url == null || getResourceUnsupported) { > try { > CodeSource codeSource = > loader.loadClass(className) > .getProtectionDomain() Surely the boolean getResourceUnsupported is not needed? If the catch block is triggered, url will be null anyway. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org