Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
* Copyright 2002-2018 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.
|
||||
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.FactoryBeanNotInitializedException;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
@@ -153,7 +154,7 @@ public abstract class AbstractFactoryBean<T>
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine an 'eager singleton' instance, exposed in case of a
|
||||
* Determine an 'early singleton' instance, exposed in case of a
|
||||
* circular reference. Not called in a non-circular scenario.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -176,9 +177,7 @@ public abstract class AbstractFactoryBean<T>
|
||||
* @throws IllegalStateException if the singleton instance is not initialized
|
||||
*/
|
||||
private T getSingletonInstance() throws IllegalStateException {
|
||||
if (!this.initialized) {
|
||||
throw new IllegalStateException("Singleton instance not initialized yet");
|
||||
}
|
||||
Assert.state(this.initialized, "Singleton instance not initialized yet");
|
||||
return this.singletonInstance;
|
||||
}
|
||||
|
||||
@@ -218,7 +217,7 @@ public abstract class AbstractFactoryBean<T>
|
||||
* FactoryBean is supposed to implement, for use with an 'early singleton
|
||||
* proxy' that will be exposed in case of a circular reference.
|
||||
* <p>The default implementation returns this FactoryBean's object type,
|
||||
* provided that it is an interface, or {@code null} else. The latter
|
||||
* provided that it is an interface, or {@code null} otherwise. The latter
|
||||
* indicates that early singleton access is not supported by this FactoryBean.
|
||||
* This will lead to a FactoryBeanNotInitializedException getting thrown.
|
||||
* @return the interfaces to use for 'early singletons',
|
||||
|
||||
Reference in New Issue
Block a user