Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2338

Type inference failure with generics and lambdas

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 10.0
    • None
    • None

    Description

      In the attached example, the compiler detects types properly in the

      listMapperCollector()

      method, but not in the

      listMapperCollector(Comparator<ID> sorter)

      method, where it fails on determining the type of e in

      e -> e.getId()

      on line 31.

      The code is for Java 8, and compiles normally with OpenJDK 8.

      Aside from one or two exceptions (because of the types of their primary keys), all of my JPA entity classes implement this interface.

      Attachments

        1. EntityWithId.java
          2 kB
          Yordan Gigov

        Activity

          People

            Unassigned Unassigned
            coladict Yordan Gigov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: