[ 
https://issues.apache.org/jira/browse/OPENJPA-2492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13975867#comment-13975867
 ] 

Kevin Sutter commented on OPENJPA-2492:
---------------------------------------

Initial view of the patch looks good.  In my experimentation, I had done 
something similar in ProxyManagerImpl.  Except I had just checked for any 
return type that contained "KeySetView"...  Something like this:

                if (meths[i].getReturnType().toString().contains("KeySetView")) 
continue;  // KWS

Don't know if this is any better or worse performing than your check, but at 
least we were on the same page.

The one piece of your patch that I hadn't gotten to yet is beforeGet method in 
ProxyMaps:

        return map.keySet().contains(key);

I think this was the key element of your patch.  Thanks.  The other changes in 
your patch seemed to be just window dressing.  You cleaned up a conditional to 
use a method invocation, and you added a couple of asserts to a testcase.  But, 
neither of these seemed critical to success.  Agree?

I'll take a look at the patch you posted for openjpa-2489 shortly...  Maybe 
we're getting close to actually building JPA apps with Java 8.  Thanks for your 
help!

> TestConcurrentMap error with Java 8
> -----------------------------------
>
>                 Key: OPENJPA-2492
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2492
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: build / infrastructure, Enhance, jpa
>    Affects Versions: 2.4.0
>         Environment: Java 8
> java version "1.8.0"
> Java(TM) SE Runtime Environment (build 1.8.0-b132)
> Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)
>            Reporter: Kevin Sutter
>         Attachments: OPENJPA-2492.patch
>
>
> One more test failure while running with Java 8.  Since Java 8 introduced 
> some new methods on the Map interface, this is probably related.  We are 
> getting a VerifyError related to the keySet signature:
> Tests in error:
> testConcurrentMap001(org.apache.openjpa.persistence.relations.TestConcurrentMap)
>     <error message="(class: 
> org/apache/openjpa/util/java$util$concurrent$ConcurrentHashMap$4$proxy, 
> method: keySet signature: 
> ()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;) Wrong return type in 
> function" type="java.lang.VerifyError">java.lang.VerifyError: (class: 
> org/apache/openjpa/util/java$util$concurrent$ConcurrentHashMap$4$proxy, 
> method: keySet signature: 
> ()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;) Wrong return type in 
> function
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:340)
>         at 
> org.apache.openjpa.util.GeneratedClasses.loadBCClass(GeneratedClasses.java:68)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to