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

Remove wildcard bound in PositionWindows.positionTestWindows

XMLWordPrintable

    • b21
    • 22
    • b18

        Currently, PassFailJFrame.PositionWindows.positionTestWindows declares its testWindows parameter with the type of List<? extends Window> which was introduced in JDK-8294156 and later made available in JDK-8340210.

        Internally, the window list is a simple List<Window>.

        The wildcard is useful for the return type of the createTestUI method in WindowListCreator so that the code in a test could use List<JFrame> instead of List<Window> as well as pass Frame or JFrame.

        By the time, PositionWindows.positionTestWindows comes into play, List<Window> is enough.


        The type of PositionWindows.positionTestWindows can be changed to List<Window>.

        It is a backwards compatible change, any test which declared its method for positionTestWindows with List<? extends Window> continues to compile successfully.

        Yet the opposite is not true: List<Window> isn't compatible with the current List<? extends Window>.

              aivanov Alexey Ivanov
              aivanov Alexey Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: