Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for cross-compile(from java 8 to java 7) in RequestContext(ConcurrentHashMap) #401

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand All @@ -54,7 +57,9 @@
* Date: 10/13/11
* Time: 10:21 AM
*/
public class RequestContext extends ConcurrentHashMap<String, Object> {
public class RequestContext implements ConcurrentMap<String,Object> {

private ConcurrentMap<String,Object> concurrentMap = new ConcurrentHashMap<String,Object>();

private static final Logger LOG = LoggerFactory.getLogger(RequestContext.class);

Expand Down Expand Up @@ -536,6 +541,9 @@ public void unset() {
threadLocal.remove();
}




/**
* Mkaes a copy of the RequestContext. This is used for debugging.
*
Expand Down Expand Up @@ -582,6 +590,95 @@ public void setRequestQueryParams(Map<String, List<String>> qp) {
put("requestQueryParams", qp);
}

@Override
public Object putIfAbsent(String key, Object value) {
return concurrentMap.putIfAbsent(key, value);
}

@Override
public boolean remove(Object key, Object value) {
return concurrentMap.remove(key, value);
}

@Override
public boolean replace(String key, Object oldValue, Object newValue) {
return concurrentMap.replace(key, oldValue, newValue);
}

@Override
public Object replace(String key, Object value) {
return concurrentMap.replace(key, value);
}

@Override
public int size() {
return concurrentMap.size();
}

@Override
public boolean isEmpty() {
return concurrentMap.isEmpty();
}

@Override
public boolean containsKey(Object key) {
return concurrentMap.containsKey(key);
}

@Override
public boolean containsValue(Object value) {
return concurrentMap.containsValue(value);
}

@Override
public Object get(Object key) {
return concurrentMap.get(key);
}

@Override
public Object put(String key, Object value) {
return concurrentMap.put(key, value);
}

@Override
public Object remove(Object key) {
return concurrentMap.remove(key);
}

@Override
public void putAll(Map<? extends String, ?> m) {
concurrentMap.putAll(m);
}

@Override
public void clear() {
concurrentMap.clear();
}

@Override
public Set<String> keySet() {
return concurrentMap.keySet();
}

@Override
public Collection<Object> values() {
return concurrentMap.values();
}

@Override
public Set<Entry<String, Object>> entrySet() {
return concurrentMap.entrySet();
}

@Override
public boolean equals(Object o) {
return concurrentMap.equals(o);
}

@Override
public int hashCode() {
return concurrentMap.hashCode();
}

@RunWith(MockitoJUnitRunner.class)
public static class UnitTest {
Expand Down