Skip to content

Commit 0268e76

Browse files
stsypanovsbrannen
authored andcommitted
Improve mapping function in ExtendedEntityManagerCreator.createProxy()
Closes gh-27456
1 parent 4ec8ae4 commit 0268e76

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spring-orm/src/main/java/org/springframework/orm/jpa/ExtendedEntityManagerCreator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ private static EntityManager createProxy(
230230

231231
if (emIfc != null) {
232232
interfaces = cachedEntityManagerInterfaces.computeIfAbsent(emIfc, key -> {
233-
Set<Class<?>> ifcs = new LinkedHashSet<>(4);
234-
ifcs.add(key);
235-
ifcs.add(EntityManagerProxy.class);
236-
return ClassUtils.toClassArray(ifcs);
233+
if (EntityManagerProxy.class.equals(key)) {
234+
return new Class<?>[] {key};
235+
}
236+
return new Class<?>[] {key, EntityManagerProxy.class};
237237
});
238238
}
239239
else {

0 commit comments

Comments
 (0)