From 4a678f6bbbe240ee6ee4e85161e487163ab7f475 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Mon, 21 Aug 2023 15:06:44 +0200 Subject: [PATCH] WW-5331 Adds missing @Override annotations --- .../java/org/apache/struts2/dispatcher/ApplicationMap.java | 4 ++-- .../org/apache/struts2/portlet/PortletApplicationMap.java | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/dispatcher/ApplicationMap.java b/core/src/main/java/org/apache/struts2/dispatcher/ApplicationMap.java index e678d9ec5..f0c5b4bf2 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/ApplicationMap.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/ApplicationMap.java @@ -36,10 +36,9 @@ public class ApplicationMap extends AbstractMap implements Seria private static final long serialVersionUID = 9136809763083228202L; - private ServletContext context; + private final ServletContext context; private Set> entries; - /** * Creates a new map object given the servlet context. * @@ -117,6 +116,7 @@ public class ApplicationMap extends AbstractMap implements Seria * @param key the entry key. * @return the servlet context attribute or init parameter or null if the entry is not found. */ + @Override public Object get(final Object key) { if (key == null) { return null; diff --git a/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletApplicationMap.java b/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletApplicationMap.java index 73d432390..701deb004 100644 --- a/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletApplicationMap.java +++ b/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletApplicationMap.java @@ -35,8 +35,7 @@ public class PortletApplicationMap extends AbstractMap implement private static final long serialVersionUID = 2296107511063504414L; - private PortletContext context; - + private final PortletContext context; private Set> entries; /** @@ -52,6 +51,7 @@ public class PortletApplicationMap extends AbstractMap implement * Removes all entries from the Map and removes all attributes from the * portlet context. */ + @Override public void clear() { entries = null; @@ -69,6 +69,7 @@ public class PortletApplicationMap extends AbstractMap implement * @return a Set of all portlet context attributes as well as context init * parameters. */ + @Override public Set> entrySet() { if (entries == null) { entries = new HashSet>(); @@ -160,6 +161,7 @@ public class PortletApplicationMap extends AbstractMap implement * @return the portlet context attribute or init parameter or null * if the entry is not found. */ + @Override public Object get(Object key) { if (key == null) { return null; @@ -180,6 +182,7 @@ public class PortletApplicationMap extends AbstractMap implement * the value to set. * @return the attribute that was just set. */ + @Override public Object put(String key, Object value) { entries = null; context.setAttribute(key, value);