mirror of https://github.com/apache/openjpa.git
OPENJPA-2442. Just using ProxyConcurrentMaps for proxying the Map methods. Since this extends ProxyMaps anyway, this is pretty safe change. This change resolves the TestProxyManager errors in openjpa-kernel when testing with Java 8 runtime. And, it doesn't affect Java 7 runtime at all. Refer to the Comments section for more details.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1586651 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c0b6d88285
commit
b3d7fe8829
|
@ -26,7 +26,7 @@ import java.util.Map;
|
|||
*/
|
||||
public class ProxyConcurrentMaps extends ProxyMaps {
|
||||
/**
|
||||
* Call before invoking {@link Map#remove} on super.
|
||||
* Call before invoking {@link Map#remove(key, value) } on super.
|
||||
*/
|
||||
public static boolean beforeRemove(ProxyMap map, Object key, Object value) {
|
||||
dirty(map, false);
|
||||
|
@ -34,7 +34,7 @@ public class ProxyConcurrentMaps extends ProxyMaps {
|
|||
}
|
||||
|
||||
/**
|
||||
* Call after invoking {@link Map#remove} on super.
|
||||
* Call after invoking {@link Map#remove(key, value) } on super.
|
||||
*
|
||||
* @param ret the return value from the super's method
|
||||
* @param before the return value from {@link #beforeRemove}
|
||||
|
|
|
@ -58,7 +58,6 @@ import org.apache.openjpa.lib.util.Localizer;
|
|||
import org.apache.openjpa.lib.util.Options;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import serp.bytecode.BCClass;
|
||||
import serp.bytecode.BCField;
|
||||
|
@ -632,8 +631,7 @@ public class ProxyManagerImpl
|
|||
delegateConstructors(bc, type);
|
||||
addProxyMethods(bc, false);
|
||||
addProxyMapMethods(bc, type);
|
||||
Class<? extends ProxyMaps> mapProxyClassType =
|
||||
ConcurrentMap.class.isAssignableFrom(type) ? ProxyConcurrentMaps.class : ProxyMaps.class;
|
||||
Class<? extends ProxyMaps> mapProxyClassType = ProxyConcurrentMaps.class;
|
||||
proxyRecognizedMethods(bc, type, mapProxyClassType, ProxyMap.class);
|
||||
proxySetters(bc, type);
|
||||
addWriteReplaceMethod(bc, runtime);
|
||||
|
@ -1338,7 +1336,7 @@ public class ProxyManagerImpl
|
|||
|
||||
// first check for overriding method
|
||||
try {
|
||||
match = helper.getMethod(meths[i].getName(), params);
|
||||
match = helper.getMethod(meths[i].getName(), params);
|
||||
proxyOverrideMethod(bc, meths[i], match, params);
|
||||
continue;
|
||||
} catch (NoSuchMethodException nsme) {
|
||||
|
|
Loading…
Reference in New Issue