mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
Merge pull request #844 from apache/fix/WW-5387-remove
[WW-5387] Fixes remove() signature
This commit is contained in:
@@ -151,11 +151,16 @@ public class ApplicationMap extends AbstractMap<String, Object> implements Seria
|
||||
* @param key the attribute to remove.
|
||||
* @return the entry that was just removed.
|
||||
*/
|
||||
public Object remove(final String key) {
|
||||
@Override
|
||||
public Object remove(Object key) {
|
||||
if (key == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
entries = null;
|
||||
|
||||
Object value = get(key);
|
||||
context.removeAttribute(key);
|
||||
context.removeAttribute(key.toString());
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -125,11 +125,16 @@ public class RequestMap extends AbstractMap<String, Object> implements Serializa
|
||||
* @param key the name of the attribute to remove.
|
||||
* @return the value that was removed or <tt>null</tt> if the value was not found (and hence, not removed).
|
||||
*/
|
||||
public Object remove(final String key) {
|
||||
@Override
|
||||
public Object remove(final Object key) {
|
||||
if (key == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
entries = null;
|
||||
|
||||
Object value = get(key);
|
||||
request.removeAttribute(key);
|
||||
request.removeAttribute(key.toString());
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -197,11 +197,16 @@ public class PortletApplicationMap extends AbstractMap<String, Object> implement
|
||||
* the attribute to remove.
|
||||
* @return the entry that was just removed.
|
||||
*/
|
||||
public Object remove(String key) {
|
||||
@Override
|
||||
public Object remove(Object key) {
|
||||
if (key == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
entries = null;
|
||||
|
||||
Object value = get(key);
|
||||
context.removeAttribute(key);
|
||||
context.removeAttribute(key.toString());
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user