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

Change XPathFunction.evaluate parameter type from List<Object> to List<?>

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 10
    • xml
    • None
    • source
    • minimal
    • Hide
      This is on top of the previous change in JDK-8191038, compatibility analysis shall therefore be done by comparing List and List<?>.

      When the parameter was List, implementations of XPathFunction could only be the raw type List. A caller of the method can use List, List<Object>, and other types such as List<String>.

      When the type is changed to List<?>, implementations with raw type List will continue to work as is. There is therefore no compatibility risk.

      Furthermore, new implementations can now be implemented with List<?> to avoid compilation warnings.
      Show
      This is on top of the previous change in JDK-8191038 , compatibility analysis shall therefore be done by comparing List and List<?>. When the parameter was List, implementations of XPathFunction could only be the raw type List. A caller of the method can use List, List<Object>, and other types such as List<String>. When the type is changed to List<?>, implementations with raw type List will continue to work as is. There is therefore no compatibility risk. Furthermore, new implementations can now be implemented with List<?> to avoid compilation warnings.
    • Java API
    • SE

      Summary

      Change the type of the parameter for XPathFunction.evaluate from List<Object> to List<?>.

      Problem

      In JDK-8191038, the type of the parameter for XPathFunction.evaluate was changed from List to List<Object>. However, a better compatibility may be provided by generifying the evaluate method to accept a List<?> rather than a List<Object>.

      Solution

      Change the type of the parameter for XPathFunction.evaluate from List<Object> to List<?>.

      Specification

      src/java.xml/share/classes/javax/xml/xpath/XPathFunction.java

      - public Object evaluate(List<Object> args)
      + public Object evaluate(List<?> args)

            joehw Joe Wang
            darcy Joe Darcy
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: