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

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

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: xml
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      source
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      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.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      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)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                joehw Joe Wang
                Reporter:
                darcy Joe Darcy
                Reviewed By:
                Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: