Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

HHH-8922 ClassLoaderServiceImpl#getResources should use LinkedHashSet to

preserve ordering
  • Loading branch information...
commit c8116f5184f420ea2b39f947643e7c510d44c72b 1 parent 2d964f1
@brmeyer brmeyer authored
View
4 hibernate-core/src/main/java/org/hibernate/boot/registry/classloading/internal/ClassLoaderServiceImpl.java
@@ -31,7 +31,6 @@
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;
@@ -43,7 +42,6 @@
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.util.ClassLoaderHelper;
-
import org.jboss.logging.Logger;
/**
@@ -182,7 +180,7 @@ private AggregatedClassLoader(final LinkedHashSet<ClassLoader> orderedClassLoade
@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
6 hibernate-osgi/src/main/java/org/hibernate/osgi/OsgiClassLoader.java
@@ -27,7 +27,7 @@
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;
@@ -46,8 +46,8 @@
public class OsgiClassLoader extends ClassLoader implements Stoppable {
// 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<?>>();
private Map<String, URL> resourceCache = new HashMap<String, URL>();
Please sign in to comment.
Something went wrong with that request. Please try again.