Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8150205

Compilation error in JavaFX unit test with JDK 9: ambiguous reference

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • tools
    • None

      The attached test program compiles with JDK 8 and doesn't compile with JDK 9. I've ruled out any changes to the JavaFX classes themselves, since I can use the same jfxrt.jar from the JDK 9 promoted build and the test program compiles fine if I use JDK 8u40 javac, but fails if I use JDK 9 javac.

      $ javac TableViewMouseInputTest.java
      TableViewMouseInputTest.java:13: error: reference to select is ambiguous
              sm.select(0, firstNameCol);
                ^
        both method select(int,TableColumnBase<S,?>) in TableViewSelectionModel and method select(int,TableColumn<S,?>) in TableViewSelectionModel match
        where S is a type-variable:
          S extends Object declared in class TableViewSelectionModel
      Note: TableViewMouseInputTest.java uses unchecked or unsafe operations.
      Note: Recompile with -Xlint:unchecked for details.
      1 error

      The use of generics is a bit odd, and if I use the correct generic class everywhere it compiles fine on JDK 9, too.

            Unassigned Unassigned
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: