Reuse empty class array constant in ClassUtils
Closes gh-24221
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -232,7 +232,7 @@ public abstract class ExtendedEntityManagerCreator {
|
||||
|
||||
if (emIfc != null) {
|
||||
interfaces = cachedEntityManagerInterfaces.computeIfAbsent(emIfc, key -> {
|
||||
Set<Class<?>> ifcs = new LinkedHashSet<>();
|
||||
Set<Class<?>> ifcs = new LinkedHashSet<>(4);
|
||||
ifcs.add(key);
|
||||
ifcs.add(EntityManagerProxy.class);
|
||||
return ClassUtils.toClassArray(ifcs);
|
||||
@@ -240,8 +240,7 @@ public abstract class ExtendedEntityManagerCreator {
|
||||
}
|
||||
else {
|
||||
interfaces = cachedEntityManagerInterfaces.computeIfAbsent(rawEm.getClass(), key -> {
|
||||
Set<Class<?>> ifcs = new LinkedHashSet<>(ClassUtils
|
||||
.getAllInterfacesForClassAsSet(key, cl));
|
||||
Set<Class<?>> ifcs = new LinkedHashSet<>(ClassUtils.getAllInterfacesForClassAsSet(key, cl));
|
||||
ifcs.add(EntityManagerProxy.class);
|
||||
return ClassUtils.toClassArray(ifcs);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user