Modernize code for diamond, isEmpty & pattern matching

This commit is contained in:
Tran Ngoc Nhan
2024-09-24 01:42:38 +07:00
committed by GitHub
parent 40faaa0c15
commit fc377126de
107 changed files with 550 additions and 454 deletions

View File

@@ -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;