Polish: Lambdas should be replaced with method references
This commit is contained in:
committed by
Juergen Hoeller
parent
d3a1d44864
commit
6ea0af3540
@@ -744,8 +744,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
final FactoryBean<?> factory = (FactoryBean<?>) bean;
|
||||
boolean isEagerInit;
|
||||
if (System.getSecurityManager() != null && factory instanceof SmartFactoryBean) {
|
||||
isEagerInit = AccessController.doPrivileged((PrivilegedAction<Boolean>) () ->
|
||||
((SmartFactoryBean<?>) factory).isEagerInit(),
|
||||
isEagerInit = AccessController.doPrivileged((PrivilegedAction<Boolean>)
|
||||
((SmartFactoryBean<?>) factory)::isEagerInit,
|
||||
getAccessControlContext());
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -57,8 +57,8 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
|
||||
protected Class<?> getTypeForFactoryBean(final FactoryBean<?> factoryBean) {
|
||||
try {
|
||||
if (System.getSecurityManager() != null) {
|
||||
return AccessController.doPrivileged((PrivilegedAction<Class<?>>) () ->
|
||||
factoryBean.getObjectType(), getAccessControlContext());
|
||||
return AccessController.doPrivileged((PrivilegedAction<Class<?>>)
|
||||
factoryBean::getObjectType, getAccessControlContext());
|
||||
}
|
||||
else {
|
||||
return factoryBean.getObjectType();
|
||||
@@ -151,8 +151,7 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
|
||||
if (System.getSecurityManager() != null) {
|
||||
AccessControlContext acc = getAccessControlContext();
|
||||
try {
|
||||
object = AccessController.doPrivileged((PrivilegedExceptionAction<Object>) () ->
|
||||
factory.getObject(), acc);
|
||||
object = AccessController.doPrivileged((PrivilegedExceptionAction<Object>) factory::getObject, acc);
|
||||
}
|
||||
catch (PrivilegedActionException pae) {
|
||||
throw pae.getException();
|
||||
|
||||
@@ -72,7 +72,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
|
||||
try {
|
||||
if (System.getSecurityManager() != null) {
|
||||
constructorToUse = AccessController.doPrivileged(
|
||||
(PrivilegedExceptionAction<Constructor<?>>) () -> clazz.getDeclaredConstructor());
|
||||
(PrivilegedExceptionAction<Constructor<?>>) clazz::getDeclaredConstructor);
|
||||
}
|
||||
else {
|
||||
constructorToUse = clazz.getDeclaredConstructor();
|
||||
|
||||
Reference in New Issue
Block a user