Modernize code for diamond, isEmpty & pattern matching
This commit is contained in:
@@ -48,6 +48,7 @@ import org.springframework.util.Assert;
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
* @author Trung Pham
|
||||
* @author Ngoc Nhan
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
@@ -118,7 +119,7 @@ public class NotificationPublishingMessageHandler extends AbstractMessageHandler
|
||||
Map<String, MBeanExporter> exporters =
|
||||
BeanFactoryUtils.beansOfTypeIncludingAncestors((ListableBeanFactory) beanFactory,
|
||||
MBeanExporter.class);
|
||||
Assert.state(exporters.size() > 0, "No MBeanExporter is available in the current context.");
|
||||
Assert.state(!exporters.isEmpty(), "No MBeanExporter is available in the current context.");
|
||||
MBeanExporter exporter = null;
|
||||
for (MBeanExporter exp : exporters.values()) {
|
||||
exporter = exp;
|
||||
|
||||
Reference in New Issue
Block a user