This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit f4a5572b1493de260085e78df4d24d3c36a45173 Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Jul 8 13:02:38 2019 +0100 Use enhanced for-loops. Based on PR #177 by Govinda Sakhare. --- java/org/apache/catalina/core/ApplicationContext.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java/org/apache/catalina/core/ApplicationContext.java b/java/org/apache/catalina/core/ApplicationContext.java index 250061a..c243072 100644 --- a/java/org/apache/catalina/core/ApplicationContext.java +++ b/java/org/apache/catalina/core/ApplicationContext.java @@ -681,11 +681,11 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S } ServletContextAttributeEvent event = new ServletContextAttributeEvent( context.getServletContext(), name, value); - for (int i = 0; i < listeners.length; i++) { - if (!(listeners[i] instanceof ServletContextAttributeListener)) { + for (Object obj : listeners) { + if (!(obj instanceof ServletContextAttributeListener)) { continue; } - ServletContextAttributeListener listener = (ServletContextAttributeListener) listeners[i]; + ServletContextAttributeListener listener = (ServletContextAttributeListener) obj; try { context.fireContainerEvent("beforeContextAttributeRemoved", listener); listener.attributeRemoved(event); @@ -734,11 +734,11 @@ public class ApplicationContext implements org.apache.catalina.servlet4preview.S event = new ServletContextAttributeEvent(context.getServletContext(), name, value); } - for (int i = 0; i < listeners.length; i++) { - if (!(listeners[i] instanceof ServletContextAttributeListener)) { + for (Object obj : listeners) { + if (!(obj instanceof ServletContextAttributeListener)) { continue; } - ServletContextAttributeListener listener = (ServletContextAttributeListener) listeners[i]; + ServletContextAttributeListener listener = (ServletContextAttributeListener) obj; try { if (replaced) { context.fireContainerEvent("beforeContextAttributeReplaced", listener); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org