pluginClassLoaderGetResources.diff
org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/PluginClassLoader.java (copia de trabajo) | ||
---|---|---|
387 | 387 |
|
388 | 388 |
@Override |
389 | 389 |
public Enumeration<URL> getResources(String name) throws IOException { |
390 |
HashSet visitedPlugins = new HashSet(); |
|
391 |
return getResources(name, visitedPlugins); |
|
392 |
} |
|
393 |
|
|
394 |
protected Enumeration<URL> getResources(String name, HashSet<PluginClassLoader> visitedPlugins) throws IOException { |
|
390 | 395 |
List<URL> resources = new ArrayList<>(); |
391 | 396 |
Enumeration<URL> aux = super.getResources(name); |
392 | 397 |
while(aux.hasMoreElements()){ |
393 | 398 |
URL url = aux.nextElement(); |
394 | 399 |
resources.add(url); |
395 | 400 |
} |
401 |
visitedPlugins.add(this); |
|
402 | ||
396 | 403 |
for(PluginClassLoader loader: this.pluginLoaders){ |
397 |
aux = loader.getResources(name); |
|
398 |
while(aux.hasMoreElements()){ |
|
399 |
URL url = aux.nextElement(); |
|
400 |
resources.add(url); |
|
401 |
} |
|
404 |
if (!visitedPlugins.contains(loader)) { |
|
405 |
aux = loader.getResources(name, visitedPlugins); |
|
406 |
while(aux.hasMoreElements()){ |
|
407 |
URL url = aux.nextElement(); |
|
408 |
resources.add(url); |
|
409 |
} |
|
410 |
} |
|
402 | 411 |
} |
403 | 412 |
|
404 | 413 |
return Collections.enumeration(resources); |