commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
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:26:07 GMT
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


Mime
View raw message