openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwsut...@apache.org
Subject svn commit: r1586651 - in /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util: ProxyConcurrentMaps.java ProxyManagerImpl.java
Date Fri, 11 Apr 2014 13:33:06 GMT
Author: kwsutter
Date: Fri Apr 11 13:33:05 2014
New Revision: 1586651

URL: http://svn.apache.org/r1586651
Log:
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.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyConcurrentMaps.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyConcurrentMaps.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyConcurrentMaps.java?rev=1586651&r1=1586650&r2=1586651&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyConcurrentMaps.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyConcurrentMaps.java
Fri Apr 11 13:33:05 2014
@@ -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
     }
     
     /**
-     * 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}

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java?rev=1586651&r1=1586650&r2=1586651&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/ProxyManagerImpl.java
Fri Apr 11 13:33:05 2014
@@ -58,7 +58,6 @@ import org.apache.openjpa.lib.util.Local
 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) {



Mime
View raw message