Merge pull request #844 from apache/fix/WW-5387-remove

[WW-5387] Fixes remove() signature
This commit is contained in:
Lukasz Lenart
2024-01-17 13:23:29 +01:00
committed by GitHub
3 changed files with 21 additions and 6 deletions
@@ -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;
}