Nullability fine-tuning based on IntelliJ IDEA 2018.3 inspection

Issue: SPR-15540
This commit is contained in:
Juergen Hoeller
2018-11-22 16:12:38 +01:00
parent b1b28d4641
commit bf272b0b21
14 changed files with 66 additions and 66 deletions

View File

@@ -393,6 +393,7 @@ class ConfigurationClassEnhancer {
Object beanInstance = (useArgs ? beanFactory.getBean(beanName, beanMethodArgs) :
beanFactory.getBean(beanName));
if (!ClassUtils.isAssignableValue(beanMethod.getReturnType(), beanInstance)) {
// Detect package-protected NullBean instance through equals(null) check
if (beanInstance.equals(null)) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("@Bean method %s.%s called as bean reference " +

View File

@@ -170,11 +170,12 @@ public class ConnectorServerFactoryBean extends MBeanRegistrationSupport
try {
if (this.threaded) {
// Start the connector server asynchronously (in a separate thread).
final JMXConnectorServer serverToStart = this.connectorServer;
Thread connectorThread = new Thread() {
@Override
public void run() {
try {
connectorServer.start();
serverToStart.start();
}
catch (IOException ex) {
throw new JmxException("Could not start JMX connector server after delay", ex);