This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch fix/WW-5331-proper-get
in repository https://gitbox.apache.org/repos/asf/struts.git
The following commit(s) were added to refs/heads/fix/WW-5331-proper-get by this
push:
new 4a678f6bb WW-5331 Adds missing @Override annotations
4a678f6bb is described below
commit 4a678f6bbbe240ee6ee4e85161e487163ab7f475
Author: Lukasz Lenart <[email protected]>
AuthorDate: Mon Aug 21 15:06:44 2023 +0200
WW-5331 Adds missing @Override annotations
---
.../main/java/org/apache/struts2/dispatcher/ApplicationMap.java | 4 ++--
.../java/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<String,
Object> implements Seria
private static final long serialVersionUID = 9136809763083228202L;
- private ServletContext context;
+ private final ServletContext context;
private Set<Entry<String, Object>> entries;
-
/**
* Creates a new map object given the servlet context.
*
@@ -117,6 +116,7 @@ public class ApplicationMap extends AbstractMap<String,
Object> implements Seria
* @param key the entry key.
* @return the servlet context attribute or init parameter or
<tt>null</tt> 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<String, Object> implement
private static final long serialVersionUID = 2296107511063504414L;
- private PortletContext context;
-
+ private final PortletContext context;
private Set<Entry<String, Object>> entries;
/**
@@ -52,6 +51,7 @@ public class PortletApplicationMap extends
AbstractMap<String, Object> 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<String, Object> implement
* @return a Set of all portlet context attributes as well as context init
* parameters.
*/
+ @Override
public Set<Entry<String, Object>> entrySet() {
if (entries == null) {
entries = new HashSet<Entry<String, Object>>();
@@ -160,6 +161,7 @@ public class PortletApplicationMap extends
AbstractMap<String, Object> implement
* @return the portlet context attribute or init parameter or <tt>null</tt>
* 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<String, Object> 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);