commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Tripodi <simonetrip...@apache.org>
Subject Re: svn commit: r1090700 - in /commons/proper/discovery/trunk: RELEASE-NOTES.txt src/changes/changes.xml src/java/org/apache/commons/discovery/resource/classes/DiscoverClasses.java
Date Sat, 09 Apr 2011 23:32:47 GMT
right, I originally intended handling different situation, but the
null check is more than enough
thanks!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Sun, Apr 10, 2011 at 1:26 AM, sebb <sebbaz@gmail.com> wrote:
> On 9 April 2011 23:48,  <simonetripodi@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-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message