Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.0
    • Fix Version/s: 2.4.0
    • Component/s: jdbc
    • Labels:
      None
    • 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)

      Description

      Several proxy tests are failing in the openjpa-persistence-jdbc bucket related to the delayed collection tests. Most likely this is due to the Map interface changes introduced by Java 8. List of failed tests:

      Failed tests:
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.hset.TestDelayedHashSetProxyDetachLite)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.hset.TestDelayedHashSetProxy)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.pqueue.TestDelayedPriorityQueueProxyDetachLite)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.llist.TestDelayedLinkedListProxyDetachLite)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.llist.TestDelayedLinkedListProxy)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.tset.TestDelayedTreeSetProxy)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.lhset.TestDelayedLinkedHashSetProxyDetachLite)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.lhset.TestDelayedLinkedHashSetProxy)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.vec.TestDelayedVectorProxy)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.tset.TestDelayedTreeSetProxyDetachLite)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.alist.TestDelayedArrayListProxyDetachLite)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.alist.TestDelayedArrayListProxy)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.pqueue.TestDelayedPriorityQueueProxy)
      testProxyMethods(org.apache.openjpa.persistence.proxy.delayed.vec.TestDelayedVectorProxyDetachLite)

      I took a quick look at the surefire report and the error makes no sense why Java 8 would affect this outcome:

      <failure message="Expected regular expression <SELECT .* DC_EMPLOYEE .* >
      to be contained in SQL statements:
      SELECT t0.id FROM DC_DEPARTMENT t0 WHERE t0.id = ?
      SELECT t0.awdName, t0.awdType FROM DC_DEP_AWD t0 WHERE t0.DEPARTMENT_ID = ?
      SELECT t1.id, t1.name FROM DC_DEP_PRD t0 INNER JOIN Product t1 ON t0.PRODUCTS_ID = t1.id WHERE t0.DEPARTMENT_ID = ?

      We will need to resolve this before claiming support for Java 8.

        Issue Links

          Activity

          Hide
          romain.manni-bucau Romain Manni-Bucau added a comment -

          wouldn't be easier to replace ProxyManagerImpl.getFactoryProxyCollection and newCollectionProxy by the generation of a proxy. This would fix java 8 issue which are not solvable with implementation since you need to use java 8 types in this case (for keySet at least in Map)

          Show
          romain.manni-bucau Romain Manni-Bucau added a comment - wouldn't be easier to replace ProxyManagerImpl.getFactoryProxyCollection and newCollectionProxy by the generation of a proxy. This would fix java 8 issue which are not solvable with implementation since you need to use java 8 types in this case (for keySet at least in Map)
          Hide
          romain.manni-bucau Romain Manni-Bucau added a comment - - edited

          looked a bit more and think it comes from the fact new java 8 methods are not handled (for instance spliterator()) etc, adding this block helps:

                  // java 8: api we can't import so either we ignore it (acceptable IMO) for now
                  // or we generate it through asm if needed
                  _ignoreMethods.add(stringMethodName("spliterator", null));
                  _ignoreMethods.add(stringMethodName("stream", null));
                  _ignoreMethods.add(stringMethodName("parallelStream", null));
                  _ignoreMethods.add("removeIf:java.util.function.Predicate");
                  _ignoreMethods.add("forEach:java.util.function.Consumer");
                  _ignoreMethods.add("replaceAll:java.util.function.UnaryOperator");
                  _ignoreMethods.add("sort:java.util.Comparator");
          
          Show
          romain.manni-bucau Romain Manni-Bucau added a comment - - edited looked a bit more and think it comes from the fact new java 8 methods are not handled (for instance spliterator()) etc, adding this block helps: // java 8: api we can't import so either we ignore it (acceptable IMO) for now // or we generate it through asm if needed _ignoreMethods.add(stringMethodName( "spliterator" , null )); _ignoreMethods.add(stringMethodName( "stream" , null )); _ignoreMethods.add(stringMethodName( "parallelStream" , null )); _ignoreMethods.add( "removeIf:java.util.function.Predicate" ); _ignoreMethods.add( "forEach:java.util.function.Consumer" ); _ignoreMethods.add( "replaceAll:java.util.function.UnaryOperator" ); _ignoreMethods.add( "sort:java.util.Comparator" );
          Hide
          romain.manni-bucau Romain Manni-Bucau added a comment -

          patch ignoring j8 specific methods

          Show
          romain.manni-bucau Romain Manni-Bucau added a comment - patch ignoring j8 specific methods
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1588978 from kwsutter@apache.org in branch 'openjpa/trunk'
          [ https://svn.apache.org/r1588978 ]

          OPENJPA-2489. Committing patch as provided by Romain Manni-Bucau. This patch just modifies the testcase to skip attempting to process some new Java 8 methods that are not needed yet...

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1588978 from kwsutter@apache.org in branch 'openjpa/trunk' [ https://svn.apache.org/r1588978 ] OPENJPA-2489 . Committing patch as provided by Romain Manni-Bucau. This patch just modifies the testcase to skip attempting to process some new Java 8 methods that are not needed yet...
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 1641895 from Jody Grassel in branch 'openjpa/branches/2.2.x'
          [ https://svn.apache.org/r1641895 ]

          OPENJPA-2489: Delayed collection proxy tests failing with Java 8

          Show
          jira-bot ASF subversion and git services added a comment - Commit 1641895 from Jody Grassel in branch 'openjpa/branches/2.2.x' [ https://svn.apache.org/r1641895 ] OPENJPA-2489 : Delayed collection proxy tests failing with Java 8

            People

            • Assignee:
              kwsutter Kevin Sutter
              Reporter:
              kwsutter Kevin Sutter
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development