Nullability fine-tuning based on IntelliJ IDEA 2018.3 inspection

Issue: SPR-15540

(cherry picked from commit bf272b0b21)
This commit is contained in:
Juergen Hoeller
2018-11-22 16:12:38 +01:00
parent 23d1049363
commit e6c979606c
12 changed files with 87 additions and 85 deletions

View File

@@ -395,6 +395,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

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 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.
@@ -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);