DATACMNS-1095 - Made ObjectInstantiator public to avoid IllegalAccessErrors.

ObjectInstantiator needs to be declared public as otherwise loading the implementation class fails as it doesn't have access to the (package) private interface in a different classloader.
This commit is contained in:
Oliver Gierke
2017-06-21 17:33:28 +02:00
parent a972f7d101
commit 97bd85e628

View File

@@ -55,8 +55,7 @@ public class ClassGeneratingEntityInstantiator implements EntityInstantiator {
private final ObjectInstantiatorClassGenerator generator;
private volatile Map<TypeInformation<?>, EntityInstantiator> entityInstantiators = new HashMap<>(
32);
private volatile Map<TypeInformation<?>, EntityInstantiator> entityInstantiators = new HashMap<>(32);
/**
* Creates a new {@link ClassGeneratingEntityInstantiator}.
@@ -219,6 +218,7 @@ public class ClassGeneratingEntityInstantiator implements EntityInstantiator {
return it.getParameters().stream()//
.map(provider::getParameterValue)//
.map(value -> value.orElse(null))//
.toArray();
}).orElse(EMPTY_ARRAY);
@@ -226,10 +226,12 @@ public class ClassGeneratingEntityInstantiator implements EntityInstantiator {
}
/**
* Needs to be public as otherwise the implementation class generated does not see the interface from the classloader.
*
* @author Thomas Darimont
* @author Oliver Gierke
*/
private static interface ObjectInstantiator {
public interface ObjectInstantiator {
Object newInstance(Object... args);
}