This is an automated email from the ASF dual-hosted git repository. rmaucher pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit d73eda350853f548b1175fbf3efb15c5a42e069f Author: remm <[email protected]> AuthorDate: Thu Oct 15 21:27:10 2026 +0200 Java compatibility --- java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java | 3 ++- .../tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java | 3 ++- .../apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java b/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java index d5c24caed5..dcd0224012 100644 --- a/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java +++ b/java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java @@ -144,9 +144,10 @@ public class BaseNotificationBroadcaster implements NotificationBroadcaster { Iterator<BaseNotificationBroadcasterEntry> iterator = entries.iterator(); while (iterator.hasNext()) { BaseNotificationBroadcasterEntry item = iterator.next(); - if (item.listener != listener || !(item.filter instanceof BaseAttributeFilter filter)) { + if (item.listener != listener || !(item.filter instanceof BaseAttributeFilter)) { continue; } + BaseAttributeFilter filter = (BaseAttributeFilter) item.filter; String[] names = filter.getNames(); if (name == null) { if (names.length == 0) { diff --git a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java index d70dcb0474..4799dbc6cb 100644 --- a/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java +++ b/java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java @@ -142,10 +142,11 @@ public class MbeansDescriptorsDigesterSource extends ModelerSource { registry = Registry.getRegistry(null); } - if (!(source instanceof InputStream stream)) { + if (!(source instanceof InputStream)) { throw new IllegalArgumentException(sm.getString("registry.invalidSource")); } + InputStream stream = (InputStream) source; List<ManagedBean> loadedMbeans = new ArrayList<>(); synchronized (dLock) { if (digester == null) { diff --git a/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java b/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java index b206dc66ea..031078b713 100644 --- a/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java +++ b/test/org/apache/tomcat/util/modeler/TestBaseModelMBeanNotifications.java @@ -40,7 +40,8 @@ public class TestBaseModelMBeanNotifications { public void handleNotification(Notification notification, Object handback) { sequences.add(notification.getSequenceNumber()); String name; - if (notification instanceof AttributeChangeNotification acn) { + if (notification instanceof AttributeChangeNotification) { + AttributeChangeNotification acn = (AttributeChangeNotification) notification; changes.add(acn); name = acn.getAttributeName(); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
