HHH-8922 ClassLoaderServiceImpl#getResources should use LinkedHashSet to

preserve ordering

Conflicts:
	hibernate-core/src/main/java/org/hibernate/boot/registry/classloading/internal/ClassLoaderServiceImpl.java
This commit is contained in:
Brett Meyer 2014-02-07 10:07:31 -05:00
parent aad23dc804
commit e712a44ec3
2 changed files with 4 additions and 5 deletions

View File

@ -31,7 +31,6 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
@ -272,7 +271,7 @@ public class ClassLoaderServiceImpl implements ClassLoaderService {
@Override
public Enumeration<URL> getResources(String name) throws IOException {
final HashSet<URL> resourceUrls = new HashSet<URL>();
final LinkedHashSet<URL> resourceUrls = new LinkedHashSet<URL>();
for ( ClassLoader classLoader : individualClassLoaders ) {
final Enumeration<URL> urls = classLoader.getResources( name );

View File

@ -27,7 +27,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
@ -45,8 +45,8 @@ import org.osgi.framework.Bundle;
public class OsgiClassLoader extends ClassLoader {
// Leave these as Sets -- addClassLoader or addBundle may be called more
// than once if a SF or EMF is closed and re-created.
private Set<ClassLoader> classLoaders = new HashSet<ClassLoader>();
private Set<Bundle> bundles = new HashSet<Bundle>();
private Set<ClassLoader> classLoaders = new LinkedHashSet<ClassLoader>();
private Set<Bundle> bundles = new LinkedHashSet<Bundle>();
private Map<String, Class<?>> classCache = new HashMap<String, Class<?>>();