it's important to always return the same classloader; otherwise, the classes and hence the objects won't be compatible / equal

This commit is contained in:
Axel Uhl committed 2015-03-30 20:56:11 +02:00
1 parent 9c5978ba4f
commit e75b2e1985
1 file changed
+4 -2
@@ -379,6 +379,8 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
.withInitial(() -> false);
private final Set<ClassLoader> masterDataClassLoaders = new HashSet<ClassLoader>();
private final JoinedClassLoader joinedClassLoader;
/**
* Constructs a {@link DomainFactory base domain factory} that uses this object's {@link #competitorStore competitor
@@ -457,6 +459,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
TypeBasedServiceFinderFactory serviceFinderFactory) {
logger.info("Created " + this);
this.masterDataClassLoaders.add(this.getClass().getClassLoader());
joinedClassLoader = new JoinedClassLoader(masterDataClassLoaders);
this.operationsSentToMasterForReplication = new HashSet<>();
if (windStore == null) {
try {
@@ -2291,8 +2294,7 @@ public class RacingEventServiceImpl implements RacingEventService, ClearStateTes
@Override
public ClassLoader getDeserializationClassLoader() {
return getCombinedMasterDataClassLoader(); // FIXME bug 2743: tentatively going back to getClass().getClassLoader() to see which part of the commit was causing the two replication tests to fail
// return getClass().getClassLoader();
return joinedClassLoader;
}
@Override